
C2S – Shopify
Discover the most-read articles
The Affilae Shopify integration takes two installations: a tracking tag in your theme, which records clicks, and a custom pixel, which reports sales. You need both.
Before you start
- Your program’s URL format is set to Parameter.
- You have admin access to your Shopify store.
- You have your Program ID and your Key. To find them, in Affilae, open Manage my programs, click your program, then Configuration. In the Tracking tab, scroll down to the Integration via an Affilae plugin section.
Step 1, install the tracking tag in your theme
This tag records the click of a visitor sent by a publisher. Without it, the sale is reported with no click, so with no publisher to pay: this is the most common failure. Replace PID with your Program ID.
<script type="text/javascript">
var _ae = {
"pid":"PID",
};
(function() {
var element = document.createElement('script');
element.type = 'text/javascript';
element.async = true;
element.src = '//static.affilae.com/ae-v3.5.js';
var scr = document.getElementsByTagName('script')[0];
scr.parentNode.insertBefore(element, scr);
})();
</script>
- In your Shopify admin, open Online Store, then Themes.
- Click Actions, then Edit code.
- Open the theme.liquid file and paste the code inside the
<body>tag.
Step 2, download the plugin and pick your file
Download version 1.7.4: shopify_affilae_v1.7.4.zip
MD5 checksum, to verify the file: 0537c19dddabe87013f86789b1ad9435
The archive contains two pixels. You install only one:
Step 3, create the pixel in Shopify
- In your Shopify admin, open Settings, then Customer events.
- Click Add custom pixel and name it, for example Affilae.
- Delete the default text and paste the entire content of the file you picked in step 2.
Step 4, fill in three values
At the top of the file, edit these lines only. Leave every other line as it is.
const PROGRAM_ID = 'YOUR_PROGRAM_ID'; const KEY = 'YOUR_KEY'; const PRICES_TAX_INCLUDED = true;
- PROGRAM_ID: your Program ID.
- KEY: your Key. With shopifyPixelConversionOldNew.js, fill in KEY_CUSTOMER_NEW (new customers) and KEY_CUSTOMER_OLD (returning customers) instead.
- PRICES_TAX_INCLUDED: in Shopify, open Settings, then Taxes and duties, and look at the Include sales tax in product price and shipping rate checkbox. Checked:
true(the usual case in France and Europe). Unchecked:false.
Step 5, set the pixel’s privacy settings
- Under Customer privacy, set Permission to Not required.
- Leave Data sale on the option stating that the data collected does not qualify as a data sale.
The Affilae pixel checks the buyer’s consent itself. When the buyer has refused it, the pixel reads nothing on their device: only an order placed with a promo code is reported, attributed to that code alone and with no customer id. If you would rather Shopify loaded the pixel only with the buyer’s consent, set the permission to Required: no order placed without consent will then be reported, promo code or not.
Step 6, save, connect and test
- Save the pixel.
- Click Connect pixel.
- Place a test order and check that it appears in Affilae.
Updating a store that is already set up
- Open your Affilae pixel and replace its whole content with the new file.
- Fill in the three values from step 4 again, with the same Program ID and the same key or keys. The new file resets every other line to its original value: if Affilae support had you change another line, tell them before updating.
- Check the pixel’s privacy settings (step 5), then save and place a test order.
Related articles
- C2S, Manual
- Testing click and conversion tracking
- Affilae tracking fundamentals
- Understanding and setting up SubIDs
- Frequently asked questions, technical integration
Frequently asked questions
Version 1.7.4, offered in step 2. If your store runs an earlier version, follow the “Updating a store that is already set up” section.
In order: is the pixel connected, not just saved? Is the tracking tag in the theme? Are the Program ID and Key the real values (not {{KEY}})? Is the pixel permission set to Not required?
Yes: Affilae receives the amount excluding tax and shipping, while the Shopify total includes them. If the gap looks abnormal, check the PRICES_TAX_INCLUDED value (step 4).
Two reasons. Orders from buyers who refuse consent are not reported, except those placed with a promo code, which are attributed to that code alone. And orders that do not go through the online checkout (subscriptions, in-store sales, draft orders, orders created by an app or a logistics provider) are out of reach of any pixel.
The pixel reports Shopify’s internal id, not the #1082-style number, which is not available to it. To reconcile the two, export your conversions from Affilae: the Shopify id appears in the Conversion ID column.
Check that you installed shopifyPixelConversionOldNew.js and filled in both keys, KEY_CUSTOMER_NEW and KEY_CUSTOMER_OLD. When Shopify does not let the pixel know whether this is a first purchase, the order is counted as a new customer.