Advanced concepts
Tag managers
In the previous chapter we learnt what events, pixels and tags are. Think about all the events that need to be tracked on a modern website, especially an ecommerce one (view product, add to cart, checkout, purchase), plus all their parameters (product details, categories, discounts), and you start to see that it takes a lot of tags, and those tags need to be kept up to date with every small website change.
If tags are placed directly on the page, any change to a tag, a new advertising platform, a new event or even a new event parameter requires deploying changes to the website’s source code.
To avoid that, tag managers such as Google Tag Manager were introduced. They provide an independent tagging workspace, or container, that can be managed by the marketing team or tracking experts. They let you organise tags into folders and add notes about each change.
As a result, the development team places the tag manager code on the website once, and from then on all the work can be done in the tag manager.
Unfortunately, that is not enough. Think about all the data points that can be useful for analytics or advertising, and you’ll realise that many of them are not easily available on the page. All product categories, additional attributes, identifiers like SKUs, tax and shipping values, and user data aren’t always easily accessible to tracking tags.
Even when they are visible on the page, they are technically hard to use: their formatting may be wrong, or the visual implementation may change often.
DataLayer
The dataLayer is a layer of data, invisible to the end user and implemented as a JavaScript array, into which website or integration developers push all relevant data points in a standard, convenient format.
For instance, to track add to cart events, a tracking expert could add a tag in Google Tag Manager and try to scrape the product details from what’s visible in the shop’s UI. That is error-prone and brittle. If the add to cart action, with all relevant product details, is pushed to the website’s dataLayer instead, the solution becomes robust and reliable.
That way all tags can trigger on and read data in a standardised, reliable way, which significantly improves tracking coverage.
UTM tags
Although they are also called “tags”, UTM tags have nothing to do with website tagging. They are special parameters added to links that point to your website, in most cases links from paid campaigns. In other words, they are used to tag incoming links, or traffic, for attribution purposes.
Conceptually they are a bit like the dataLayer: they make tracking explicit. Without them, attribution is based on several different data points, such as where the user came from, which may be interpreted differently by different pixels and tracking platforms.
UTM tags, when added consistently across all campaigns, make the source of traffic explicit and reliable. The key is consistency: make sure all parameters are named the same way across traffic sources.
Link parameters are also coming under scrutiny. Safari’s Link Tracking Protection, for example, removes known click identifiers such as gclid and fbclid from links in Private Browsing, Mail and Messages, so attribution that relies only on those identifiers can break.