How to manually update the Littledata snippet on Shopify

Updated on 2021-12-29
note:

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

Steps to update

  1. In the green notification in Littledata's app, click COPY SNIPPET to copy an updated version of the code snippet into the clipboard.

tip:

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

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

  1. Under 'Snippets', find the file named LittledataLayer.liquid, or create a new snippet of that name.
  2. Select all the contents of the file, and then paste in the contents of the clipboard to overwrite it.
  3. Check the snippet  is included in the main theme layout file (theme.liquid), just before the `` 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 is uses by Littledata's app to customize the behavior of the tracking script.

 LittledataLayer = {
    // settings go here
 }; 

See the full list of data pipeline settings you can change in the app.