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.
Google Tag Manager is a free application that helps to simplify the kind of webstore integrations that require JavaScript tagging. Ultimately this can save you a lot of time and money, and it can help you mitigate risk.
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.
Tag Management Systems (TMS) are a newish type of technology, designed to remove the complexity from adding JavaScript snippets–often called “tags”–to your website. A perfect example of a tag is the snippet of JavaScript that Google Analytics requires you apply to every page of your site.
I’ll come back to that example a lot.
These bits of JavaScript are how you integrate a website with all sorts of technologies–analytics tools, ad networks, tracking tools, etc. Nowadays there are A LOT of technologies to potentially integrate with. Adding, updating, and maintaining all those tags became cumbersome for developers, so vendors like Google created tag management systems to simplify things.
Google Tag Manager makes applying JavaScript to your site easier, by providing some key features:
- Templates that help you customize your Google Analytics JavaScript without touching code
- 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!)
Remember that Google Tag Manager can be used to integrate a website with virtually any technology that requires a JavaScript tag. However, it’s especially good at integrating Google Analytics. For most of this post, I’ll use Google Analytics examples.
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.
Prior to Tag Manager, setting up eCommerce tracking meant manually updating the JavaScript snippet. Just reading Google Analytics documentation gives you a little bit of insight into how complex that can be. You have to be pretty good a writing JavaScript to make it work. Then you have to maintain what you wrote.
Adding the JavaScript tags to indicate things like “someone made a purchase” is tricky enough. You also have to write JavaScript to listen for the behaviors on your site, so you can execute the Google Analytics command at the right time.
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.
Google Tag Manager simplifies all of this by providing that framework. You still need to understand JavaScript, but the way you write and apply it is much less risky. It’s much simpler. It’s managed by a platform to help you ensure it’s always working correctly.
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.
Custom Integration
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.
Native Integration
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?”
The data layer is a JavaScript object that stores name-value pairs of data that Google Tag Manager can use within tags. Therefore, your basic set up is to push webstore transactions into the data layer, then use GTM to push those to Google Analytics from the data layer.
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.
If you can’t find a suitable plugin, then you’ll have to do some custom development. You need to expose the transaction specific variables, from your “thank you for purchasing” page, and write JavaScript that pushes them into the data layer. This is higher risk, and likely work for a developer.
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:
Google
Sites of interest we have a link to.
[…] using one of these tags, say because you don’t have an ad campaign running right now, you can use Google Tag Manager to remove the tag yourself – without always having to bug your dev […]
Very interesting! I found this article very useful. I am sharing an infographic on “100 useful tags to deploy in an E-Commerce site”. It is very useful.
Download infographic: https://goo.gl/hhWswy
[…] It’s also a time and resources burden for your dev, IT or marketing teams to deploy, test and monitor the tags throughout your MarTech system. As nChannel explains: […]