Jan 2021

How tagging works

Digital performance insight is underpinned by tagging

Tags are code that run in a user’s browser when they visit your website. They are also known as pixels

The better you understand how tagging works, the more confident you will be to make improvements

Diagram showing a simple tag firing and sending information to a database
  • When a tag fires it sends information to an external database, such as Google Analytics or HubSpot
  • Google Analytics can structure this information in various way with goals & funnels e.g. “if the tag fires on a checkout page, count it as a conversion
  • Google tags are called gtag (aka Global Site Tag; Universal Analytics). These are replacing Google’s older tags (analytics.js, ga.js & ec.js)
Diagram showing users interacting with a tag management interface to control the tags in a container on a website
  • Tag managers allow non-technical people to edit tags (e.g. to set up new analytics providers), and debug them (e.g. with Google Tag Manager’s Preview Mode)
  • Tag managers make it easy to give the same configuration to multiple tags, e.g. using variables
  • Most websites have just one container, but it’s possible to have separate ones e.g. for global & local teams
Diagram showing and event snippet taking data from a data layers and giving to the tag
  • Using event snippets gives flexibility. For example rather than having separate checkout confirmation pages, a conversion can be recorded on a button press
  • This integration involves co-ordination between what information is available in the data layer and what information the tags require, i.e. co-ordination between marketing and web developers
Diagram showing a user clicking on an ad. The link to the web page includes the Google Click Identifier, which the cookie saves for later
  • When a user clicks on an ad, a Google Click Identifier is created (GCLID). This is passed to the website via the link. This is called auto-tagging
  • On the website the Google tag saves the GCLID in a cookie
Diagram showing the user purchasing some shoes, and the Google Click Identifier being sent to the database, along with the transaction value
  • Now, by combining how much was spent on the ad with the value of the conversion, it’s possible to see the ROI of a campaign
  • If more than one type of advertising and tracking is happening at the same time, then conversions might be counted more than once. To address this issue between Display and Search, Google offers Floodlight tags
  • These diagrams cover one property which means it has one Google Analytics ID (which looks something like UA-123456789-1)
  • If your site has multiple domains like blog.site.com & app.site.com, you can set up cross-domain tracking to treat these as one
  • It’s easy to make mistakes with tags, such as double counting. The Google Tag Assistant is a great way to see what’s going on
  • Different questions are best answered in different ways. See 1-page guide to How to set up marketing analytics
  • The cookies we are talking about here are “first party cookies”, meaning that the website that is placing the cookie is the one the user is visiting. “Third party cookies” are when a user visits a website that has ads, and those ads place cookies
  • Third party cookies are blocked on iPhones, and Google has announced that it will phase out third-party cookies in Chrome by 2022. This increases the relative attractiveness of Google Ads

Copyright © 2021