Conversion tracking codes, such as a tracking pixel, can be added to your store to track customers purchasing from your store. Tracking codes typically are used on the order status page, which is the page that confirms the customer has successfully placed an order.
Tracking code (pixel)
Tracking pixel for Shopify
<!-- SLICE Digital tracking pixel :: Begin -->
<script language="JavaScript" type="text/javascript">
// Required fields
var afid = '{{ order_number }}'; // unique order or sale ID
var afprice = '{{ total_price | money_without_currency }}'; // total plan price. Sale programs - required, lead programs - optional
var afgoal = 'sale'; // goal name. Can be 'lead', 'sale', 'signup' or other
var afsecure = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // security hash provided by SLICE Digital manager
var afoffer_id = XXX; // Offer ID provided by SLICE Digital manager
var afstatus = 2; // Conversion Status: 1 - "Approved", 2 - "Pending", 3 - "Declined", 5 - "Hold"
// Optional fields
var afcomment = '{% for line_item in line_items %}&ITEM{{ forloop.index }}={{ line_item.sku }}&AMT{{ forloop.index }}={{ line_item.line_price | money_without_currency }}&QTY{{ forloop.index }}={{ line_item.quantity }}{% endfor %}'; // any comments for this order
var custom_field1 = '{{ currency }}'; // custom field 1
var custom_field2 = ''; // custom field 2
var custom_field3 = ''; // custom field 3
var custom_field4 = ''; // custom field 4
var custom_field5 = ''; // custom field 5
var custom_field6 = ''; // custom field 6
var custom_field7 = ''; // custom field 7
</script>
<script language="JavaScript" type="text/javascript" src="//track.roeye.co.nz/track.js"></script>
<!-- SLICE Digital tracking pixel :: End -->
Tracking code basic installation
Desktop (if you use desktop/web browser for managing, otherwise - go to Mobile section - you DO NOT need to use both - just choose the one you like more)
- After you have your tracking code, copy it to your clipboard with 'cmd + c' on a Mac or 'ctrl + c' on a PC.
- From your Shopify admin, click Settings, and then click Checkout.
- In the Order processing section, find the Additional scripts text box:
- Paste your tracking code from your clipboard with 'cmd + v' on a Mac or 'ctrl + v' on a PC.
Mobile (if you use Mobile app for managing, otherwise - go to Desktop section - you DO NOT need to use both - just choose the one you like more)
- After you have your tracking code, copy it to your clipboard with 'cmd + c' on a Mac or 'ctrl + c' on a PC.
- From the Shopify app, tap Store, and then tap Settings.
- Under Store settings, tap Account.
- In the Order processing section, find the Additional scripts text box:
- Paste your tracking code from your clipboard with 'cmd + v' on a Mac or 'ctrl + v' on a PC.
Shopify documentation
https://help.shopify.com/themes/customization/order-status/add-conversion-tracking-to-thank-you-page