When a user moves from the checkout page to the thank-you page, the order ID is sometimes lost and not sent to Affise via the postback pixel. Since advertisers require the order ID to approve transactions or conversions, missing IDs result in lost revenue.
This issue arises when a Shopify store uses a third-party payment gateway. In such cases, the order ID may not be passed to the thank-you page.
For such a case, you can use Shopify Pixel. This article provides a step-by-step guide on setting up Shopify Pixel for accurate tracking.
Shopify Pixel Web SDK
To set up the pixel, do the following:
Go to Offers > a certain offer > Edit offer > Postbacks > Integration pixels and select the Shopify pixel type.
2. Copy the code from the first part of the pixel.
3. In Shopify, add the first Script to the `theme.liquid` file. To do this:
a. Log in to Your Shopify Admin.
b. Go to Online Store > Themes in the left-hand menu.
c. In your current theme section, click Actions > Edit Code.
d. Open the `theme.liquid` file under the layout folder.
e. Add the script copied on the Affise Platform before the closing `</head>` tag.
f. Click Save.
4. On Affise, copy the code from the second part of the pixel.
5. Add the code to a custom pixel in Shopify Admin panel and change the tracking domain. To do this:
a. Go to Settings > Customer events and click Add custom pixel.
b. Put the copied code on the step 2 to the Code field of the newly created pixel.
6. Save changes and go to the Affise admin panel.
7. Set up a tracking link.
🔎 Add clickid={clickid} to your link. All other parameters can be added optionally to enhance your analytics.
Additionally, you can include the &goal_value=purchase to specify a particular goal. For example, if you receive different commissions for new and returning customers, you can use this parameter to distinguish between them.
The final link may look like this:
https://www.somestore.com/?utm_source=awesomenetwork&utm_medium=affiliate&utm_campaign=CPS_{clickid}_{pid}_{offer_id}_{sub1}&utm_term={offer_id}&utm_content={clickid}&clickid={clickid}
The postback will contain the following information:
sum: sale_amount (from Shopify).
action_id: orderID (checkout_completed > data.order.id. It’s an internal Order ID used in Shopify API. Find more information in Shopify Docs).
⚠️ OrderID is not the Order Number you see in the Shopify admin page, neither it’s a confirmation ID. The orderID is the only solid way to consistently keep track of order information via API.
custom_field1: sale_amount (same as sum; from Shopify).
custom_field2: currency (from Shopify).
custom_field3: date of order (from Shopify).
custom_field6: orderID (same as action_id; from Shopify).
goal_value: (optional) goal. If not present, the default goal value is used.
🔎 It’s possible to set up the pixel to send the confirmation ID or Order Number displayed on the thank-you page via custom tweaks in addition to the orderID. Contact our team if you need help with this.
Please contact the Affise Customer Support team regarding all raised questions via the e-mail: [email protected].