Note: Our Shopify app now works to track marketing attribution for payments made via CartHook. To get this working you need to follow a few steps.

This script works with the GA cross domain linker, picking up a cookie ID from your website which we can link with the order once it's purchased on Shopify.

1. Go to your CartHook 'Global Scripts' page

2. Find the 'Checkout page scripts' box

3. Paste in the following script, after any other scripts which are already present.

// Start of Littledata script 

$.getScript('', function(){
  var interval = setInterval(function(){
      if (typeof ga !== 'function') {
      var clientID = ga.getAll()[0].get('clientId')
      $.post('', {
        clientID: clientID,
        cartID: CHDataObject.checkout_session,
  }, 500)

// End of Littledata script

4. Save the changes

5. Deactivate any Google Analytics tracking

There are two instances where tracking has to be disabled:

  • First you would go to 'Integrations & Tracking' and disable the Google Analytics integration 
  • Second would be to delete the tracker placed in the Shopify Checkout funnel and save

You will start seeing sales being attributed to your marketing channels in Google Analytics.

Did this answer your question?