Google Tag Manager (GTM) is a popular solution for adding marketing tags to your ecommerce website. But, it can be complex and time-consuming to set up — not to mention the cost and hassle of ongoing maintenance.

Using Littledata’s direct analytics connectors helps you avoid this hassle by replacing GTM tags on your Shopify store. We also provide a GTM data layer for reuse with less common marketing tags.

For many ecommerce stores, including larger Shopify Plus brands on Littledata Plus plans, Littledata eliminates the need for custom GTM setup by automatically tracking common marketing channels and ecommerce checkout flows. The same is true for DTC subscription brands, as Littledata’s tracking automatically integrates with subscription apps in the Shopify checkout such as Recharge, Smartrr and Ordergroove.

To show you how Littledata can replace Google Tag Manager for your store, let’s look at the situations where it replaces GTM and what you get from the tool itself.

When will you not need Google Tag Manager?

As more DTC brands move to streamlined ecommerce platforms such as Shopify and BigCommerce, they are looking for automated tracking solutions instead of custom tracking plans.

Littledata’s connections easily replace GTM tags for:

Thanks to our robust, server-side tracking, you no longer need to maintain tagging for these data destinations. You can also forget worries about breaking the data layer and tags or tagging system when you change store themes.

Plus, Littledata’s Shopify source for Segment can relay data to hundreds of additional destinations, replacing GTM for many use cases. For example, our recent updates include support for a broader range of data destinations, such as email marketing tools and CRMs.

When will you still need Google Tag Manager?

Any further marketing tags (e.g. Pinterest, TikTok, Twitter) will still need to be set up in Google Tag Manager. If you are on a Littledata Plus plan, we can help set up those tags to ensure accurate tracking for these additional marketing channels.

We’re working on rolling out better support for Facebook’s Conversions API soon. This is essentially a server-side Facebook Ads connection, so we’re excited about the possibilities. In the meantime, we have an out-of-the-box Facebook Pixel connector in the Pixel Perfect app.

What Google Tag Manager triggers are available with Littledata?

Littledata’s tracking script for Shopify stores adds lots of detailed events which you can use to build funnels or trigger other marketing tags in GTM. For this client-side tracking, we support all the standard ecommerce events except for add to cart (which is hard to track on the browser) and checkouts.

Tip: From add-to-cart through the checkout, Littledata uses server-side tracking. Learn more about how this works for the Google Analytics and Segment destinations

So for GTM triggers, Littledata does support:

  • Product list viewed
  • Product list clicked
  • Product detail viewed
  • Thank you page
  • Customer login

We enable this additional event tracking because most marketing platforms need specific ecommerce data to enable retargeting ads, not just the page views. With Littledata, every time something triggers one of these events on your storefront, our script adds the associated product data to the GTM data layer like this:

{
    "event": "view_item",
    "ecommerce": {
        "detail": {
            "products": [
                {
                    "id": "AD-01-white-5",
                    "name": "ADIDAS | SUPERSTAR 80S",
                    "price": "170.00",
                    "brand": "ADIDAS",
                    "category": "all",
                    "variant": "5 / white",
                    "list_name": "/products/adidas-superstar-80s",
                    "handle": "adidas-superstar-80s",
                    "shopify_product_id": "4169037742142",
                    "shopify_variant_id": "30293803139134",
                    "compare_at_price": "0.00",
                    "image_url": "https://cdn.shopify.com/s/files/1/0197/3698/5662/products/44694ee386818f3276566210464cf341.jpg?v=1571736156",
                    "list_position": 4
                }
            ]
        }
    },
}

This helps with both marketing analysis and retargeting, as you can drill down to product-level data. Advanced users can get even more specific with GTM variables.

What Google Tag Manager variables are available with Littledata?

Littledata’s tracking script fetches product and customer data from Shopify and makes it available in the GTM data layer events (or the window.dataLayer array). To take advantage of this data, you can use GTM variables.

What is a GTM variable? Google defines GTM variables like this:

A variable is a named placeholder for a value that will change, such as a product name, a price value, or a date.

We make it easy to choose the right variable for your tag using our GTM variable template.

Common variables such as product SKU, price, and category are available with all product events. You can view the full list of variables here.

What’s the best practice for using Google Tag Manager with Shopify?

Google Tag Manager works by first building a single container of all the triggers, tags, and variables, then loading that container on every page. This makes it easy to maintain, but on the downside every extra tag you add to the container increases the first-time page load speed for every visitor.

Container bloat also makes GTM hard to maintain, as making a change might impact a lot of other tags.

To keep your GTM container small and lean, we recommend you:

  • Reuse variables across different tags where possible
  • Reduce the amount of custom JavaScript variables (having a consistent data layer helps)
  • Regularly review GTM to remove unused tags (quarterly works for most of our clients)

There are apps like Elevar which provide GTM templates for ecommerce sites that you may consider using.

If you have different country stores with very different marketing tags required, you might also consider having a different GTM container for each store and reusing Littledata’s GTM variable.

Is using Google Tag Manager on your Shopify store secure?

I’ve written before about how to prevent GTM being hacked, and the tips are still relevant today.

In short, GTM can be a security vulnerability — especially when you let untrusted 3rd party tracking providers load their own script on your checkout pages. You can reduce the risk by having a developer review your GTM setup and being especially careful on checkout pages.

What’s next for Littledata’s Google Tag Manager support?

We regularly add new events and properties to better support tagging, so please contact us if you have suggestions.

We are also looking at supporting server-side GTM (sGTM). Server-side tagging has the advantage of reducing the code loaded onto web pages (see best practices above) and handles customer data more securely.

Littledata’s servers already process sensitive customer data on our servers, so server-side GTM is a good fit with our philosophy of making tagging more robust and secure. In the meantime, I recommend you check out the Shopify to Segment connection, which provides these same server-side benefits without maintaining your own servers to host the tracking.