Shopify Integration
David Rolenc avatar
Written by David Rolenc
Updated over a week ago

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.

  1. 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.
    โ€‹

  2. 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.

  3. Save changes
    โ€‹

  4. 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.

  5. 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.

Did this answer your question?