Webstore integration to other technologies is usually a challenge, because every store is a little different. (Trust me…we know!) There’s also a complex ecosystem of technologies you may want to integrate into.
This post will dive into what Google Tag Manager is and how it can help you build a better webstore.
What is Google Tag Manager?
Google Tag Manager (GTM) is a free tag management system, provided by Google. It is particularly good at helping you to integrate your website with Google tools like Analytics, AdWords, and DoubleClick. It can also integrate non-Google technologies.
I’ll come back to that example a lot.
- Templates for a bunch of other technologies you might want to integrate with
- Standard rules for when to fire certain events (think “added to cart”)
- Versioning so that you can always roll back to a previous state
- A centralized place to manage all your integrations
Use of Google Tag Manager is probably not for the novice. But, if you’ve got a little technical knowledge and the desire to really get all you can from technologies like Google Analytics, Tag Manager is a really good option to consider. (And, it’s free!)
Why use Google Tag Manager on a webstore?
Google Tag Manager can be useful for pretty much any kind of website, and there are specific reasons it can be useful for your eCommerce webstore.
Simplify Google Analytics eCommerce tracking.
Google Analytics includes features for eCommerce stores, specifically. It allows you to push financial transactions into Analytics, so that you can run reports based on revenue. For example, you can see, on average, how much money someone spends if they came from a Google organic search result versus an affiliate link on x site.
Utilizing the Google Analytics features for eCommerce tracking is a bit complicated, especially for someone who is just getting started with Google Analytics.
This is all stuff that Google’s tags doesn’t really help you do. There was no easy framework or best practice to help you do it right.
The eCommerce features for Google Analytics are complicated–no way around that. But, using Google Tag Manager will help you deal with it.
Mitigate webstore version risk.
Updating the version of the webstore platform you use (Magento, Shopify, etc.) introduces risk that your integrations to any other technology will stop working. And, if you’re webstore platform is completely software-as-a-service (SaaS), you may not even know when updates or changes are made.
Generally speaking, one option for integration is to build tags or custom code into your webstore theme. This should usually be your last resort, because you’ll have to maintain that code. Most importantly, you’ll have to keep it updated to ensure compatibility with whatever version of the webstore platform you’re using.
Another option is to utilize plugins/extensions. This is a lower risk option than custom code, but not without it’s difficulties. You become dependent on the plugin creator’s timeline. They must update their plugin for compatibility, before you can.
Google Tag Manager helps to protect you from upgrade risk by providing that consistent interface between your webstore and whatever else you integrate to. You manage the integration yourself, and the Google Tag Manager set-up is so simple, that it’s highly unlikely that a version upgrade will disrupt it.
Update or replace integrations more freely.
Google Tag Manager makes it easier for you to swap out or update whatever you integrate with your webstore. Replacing your web analytics platform, for example, becomes a non-coding or minimal coding matter.
Setting up an integration with GTM is a configuration exercise. You don’t have to customize your theme. You don’t have to risk breaking something else.
GTM lets you set up and test whatever new tag-based integrations you want to use. You can do it quickly. You can do it safely.
Strategies for Integrating Google Tag Manager
Just as with any integration, you have three primary options for integrating Google Tag Manager with your webstore. But, keep in mind your options will vary by eCommerce platform.
You can modify your theme and hardcode the Google Tag Manager integration. This will result in a somewhat smaller risk than hardcoding any other integration, because the GTM integration code doesn’t ever change.
However, this is still not best practice. It should only be used if no other option is available.
Some webstore platforms will provide native integration functionality that allows you to add the Google Tag Manager code without customizing your theme and without using a plugin.
For example, some platforms offer you a free-form text field to “place code in the header” or footer. You can use these to apply the Google Tag Manager snippet, without much risk.
Note that you can make Google Tag Manager work almost completely by placing the GTM code anywhere on the page (e.g. the footer, or within <head>). But, Google recommends that you place it immediately after the opening <body> tag.
If your webstore platform doesn’t provide you a hook to place GTM’s integration code in the right place, maybe try a different approach.
Plugin or Extension
Many eCommerce platforms have rich plugin or extension ecosystems. And, many of those include plugins that allow you to hook into Google Tag Manager.
These plugins can be pretty simple. It doesn’t take much to wire up GTM. But, they could go above and beyond, by integrating into the Google Tag Manager data layer. (Great for advanced GTM users.)
Again, your ability to use a plugin or extension to wire up Google Tag Manager is completely dependent on the eCommerce platform you are using.
Setting Up eCommerce Tracking
Google Analytics offers an optional eCommerce tracking feature. It allows you to push eCommerce transaction data into Google Analytics so you can filter reports by metrics like “revenue generated”. It allows you to look at your traffic metrics in the context of “how much your marketing efforts actually make your company.”
eCommerce tracking is a more advanced feature of Google Analytics and setting it up can be a little complex on the eCommerce platform side. Everything we’ve discussed so far didn’t require custom development, because were just talking about using Google Analytics for basic pageviews/sessions/etc. eCommerce tracking may require some customization, because you need to pass data from the shopping cart to Tag Manager.
Implementing Google Analytics eCommerce tracking on your webstore is a little different for every platform. But, it always consists of these two steps:
- Make your webstore push transaction information (price, quantity, transaction ID, etc.) into the Google Tag Manager data layer.
- Set up the Google Analytics eCommerce tag within Google Tag Manager.
What is the data layer?
The data layer is the context you give to Google Tag Manager. GTM can inherently figure out things like what page the visitor is on, but typically there is additional context, specific to your business, that is useful for tagging rules.
For example: “What product was just purchased?”
How to Get Set Up
Setting up Google Tag Manager to work with Google Analytics’ eCommerce features is a task in which you want to involve a developer (or at least someone with some programming experience). It’s a little more technical than most Tag Manager tasks.
Getting set up completely depends on the eCommerce platform you chose (Magento versus Shopify versus whatever else). But, for any platform, start with looking for a pre-built extension/plugin that allows you to work with the Google Tag Manager data layer. Look for one that asks for more configuration info than your tag container ID (your unique account ID), and/or one that provides specific instructions for pushing eCommerce transactions to the data layer.
The intricate details of this set up vary by platform, and I’m already past 1500 words. So, I’m not going to get into the nitty gritty.
However, this post about setting up eCommerce tracking with Google Tag Manager and Magento is incredibly helpful. Obviously if you are using Magento, you can follow the directions verbatim. If you are using another platform, it’ll at least give you a rough idea what to do.
What To Do Next
Setting up Google Tag Manager to enhance your webstore integration is just one of the many ways you can step up your eCommerce game. Check out these other posts to help get you there: