Note: For most Shopify stores, the Littledata app automatically adds our tracking script to your shop’s template. You should update manually if you have the Shopify theme under source control.

Steps to update

1. For previous installs only, in the top of the audit page of Littledata's app, click COPY SCRIPT to copy a new version of the tracking code into the clipboard.

Tip: If you want to run this update, but do not see the COPY SCRIPT notification in the app, then please contact our support team

2. Go to Shopify Admin >  Online Store > Themes > Actions > Edit code. 

3. Under 'Snippets', find the file named LittledataLayer.liquid, or create a new snippet of that name.

4. Select all the contents of the file, and then paste in the contents of the clipboard to overwrite it.

5. Check the snippet  is included in the main theme layout file (theme.liquid), just before the `</head>` element ends.


<!-- Start of Littledata - Fix Google Analytics Script -->
{% include 'LittledataLayer' %}
<!-- End of Littledata - Fix Google Analytics Script -->

Modifying the tracking script

The snippet above generates a LittledataLayer window-scope variable, which can be edited to customize the behavior of the tracking script.


 LittledataLayer = {
    transactionWatcherURL: '',
    referralExclusion: /(paypal|visa|MasterCard|clicksafe|arcot\.com|geschuetzteinkaufen|checkout\.shopify\.com|checkout\.rechargeapps\.com|portal\.afterpay\.com|payfort)/,
    googleSignals: true,
    anonymizeIp: true,
    productClicks: true,
    persistentUserId: true,
    hideBranding: false,
    googleAdsConversionIds: ['AW-11111111', 'AW-22222222'],
    optimizeId: 'GTM-123ABC',
    singlePageApp: false,
    trackReplaceState: false,
    ecommerce: {                                 currencyCode: '{{shop.currency}}',                                impressions: []                  } }; 

A full list of the settings available is on the Shopify tracker GitHub page.