In order to successfully integrate tracking of your Shopify store, you will need to set up your system by instructions in the Quick Setup section in the system and then tracking for clicks and conversions by following the guide below.
In your Shopify admin environment, go to the section: Sales channels > submenu Online Store > In the Current theme box, click on the "three dots" button > click on Edit Code in the dropdown.
โIn the layouts folder, select the
theme.liquid
file and add the following code just before the</head>
tag.<!-- Trackdesk tracker begin -->
<script async src="//cdn.trackdesk.com/tracking.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");
trackdesk('YOUR TENANT ID', 'click');
</script>
<!-- Trackdesk tracker end -->Make sure to replace YOUR TENANT ID with your actual tenant ID.
Save changes
โNext, in your Shopify admin environment, go to the section: Settings > Checkout > Scroll down to the Order status page scripts block, and paste in the following code:
{% if first_time_accessed %}
<!-- Trackdesk tracker begin -->
<script async src="//cdn.trackdesk.com/tracking.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");
trackdesk('YOUR TENANT ID', 'conversion', {
conversionType: 'YOUR SELECTED CONVERSION TYPE',
amount: {
value: '{{ subtotal_price | divided_by: 100 }}'
},
externalId: '{{ order_number }}'
});
</script>
<!-- Trackdesk tracker end -->
{% endif %}Make sure to replace YOUR TENANT ID with your actual tenant ID.
Make sure to replace YOUR SELECTED CONVERSION TYPE with the conversion type you want to use for tracking.
Hit save, and you are done!
Testing Your Integration
Please remember to test the creation of click and conversion before starting your program. This way, you can verify that tracking has been set up correctly. You can create a test click and conversion by following the steps described here.