All About Google Tag Manager

Google Tag Manager

Google Tag Manager is a powerful tool that lets you quickly and easily tag 1 to 10,000+ pages with only the insertion of a tiny piece of code by developers into your CMS. The tagging is asynchronous, so it does not negatively impact user experience. Tagging can be done independent of CMS deployment timelines, and GTM possesses a wealth of tagging templates to facilitate implementation.

How should I structure accounts and containers in GTM?

How will you divide up the labor of maintaining your GTM containers? Will there be a single person who manages multiple GTM containers company-wide? If so, create an account in Google Tag Manager that corresponds to the company, and place one or more containers inside that account for the company's assets. Will you have multiple, different people at the corporate division level responsible for GTM containers and web properties for those divisions? If so, create GTM accounts at the division level with appropriate corresponding containers within. This way, as personnel change, GTM responsibilities can be assigned at the account level once, and the appropriate permissions are inherited by the containers without needing to maintain each one individually.

The same methodology should apply when creating Google Analytics accounts and the Google Analytics Properties underneath them. Note that the limitation on the maximum number of GA properties in the standard version of Google Analytics may play a role in varying this structure.

How many GTM containers should I create and deploy?

Do not use two where one will do. Think about the scope of your traffic. Is the visitor experiencing multiple domains and multiple subdomains in a single session? This is all one user experience, even if there is a separation of sites. To correctly measure sessions and users based on what the actual visitor experiences, use a single GTM container and a single GA property for those sites. Configure cross-domain tracking for accurate measurement. If there is a need to separate traffic for reporting purposes, use some combination of Google Analytics Segments or Google Analytics Property Views.

As a technical note: do not install multiple GTM containers on the same site. Both containers will be interacting with the same DOM/dataLayer, and changes to one could have unexpected impact on the other.

What kind of names should I give to the objects inside my GTM container?

Don't have a tag simply called "Video Tag." Instead, have a tag called "Vidyard Listener" for gathering data from the browser DOM, and another called "Vidyard Send Interaction" that records the metrics in Google Analytics. Apply the same specificity to your triggers and variables. If more than one party is updating tagging in GTM, have each party prefix their objects with company initials or personal initials to more easily identify the source of each object.

What are GTM folders?

The number of objects in a GTM container can quickly grow unnavigable and unmanageable. Creating folders that correspond to function and ownership makes it easy to find tagging objects and avoid altering the wrong ones. Create folders for video tracking, scroll tracking, vendor relationships, vendor conversion tags, legacy code, and so on. Make those folder names descriptive and meaningful.

Who needs access to GTM? What kind of access do they need?

Too many cooks spoil the pot. Not everyone needs Publish access to a container — only give someone the minimal access necessary to do the task at hand. If everyone has Publish access, the likelihood that unintended changes get pushed live increases significantly. The same principle applies to Google Analytics. The levels of access in GTM are as follows:

  • Read: Can view the container contents, but cannot make changes.
  • Edit: Can make changes, but cannot push those changes live.
  • Approve: Like Edit access, but can also create container versions.
  • Publish: Full access, and can push changes live.

What are container versions?

GTM has built-in version control. If you need to roll back an update to your tagging, you can publish a previous version of the container. The recommended approach is to copy that previous version to the current version using "Set as Latest Version", then publish the newly created version live.

Why is Google prompting me to name and describe my versions?

When you publish a GTM container, provide a clear and informative description of what you have just done. This description will be used by you and others to correctly identify a fallback point if you ever need to return to a previous version to remove a change.

Can I start editing the GTM container now?

Are you adding new functionality to a website — a new video player, a new chat widget? First, create a "sandbox" web site with its own sandbox GTM container and GA property. Add the code for the new feature to the sandbox, get everything working there, and then replicate it in the production site's GTM container.

Do I need to do everything all at once?

Don't bite off more than you can chew. Publish small, focused chunks of code that accomplish a specific function, then move on to the next piece of functionality you want to introduce. This approach reduces the complexity of tag implementation and makes troubleshooting much easier.

Do I need multiple GTM containers for multiple environments, like DEV, QA, and PROD?

Probably not. The things you want to track across all of your environments are likely the same. GTM triggers can be easily configured to prevent vendor conversion tags from firing on non-production hosts. Views can easily be created in Google Analytics to separate production from non-production traffic. Having multiple largely identical GTM containers sending traffic to separate GA properties can result in unnecessary maintenance overhead — and the risk of "misplacing" web traffic if those containers accidentally get crossed in CMS deployments.

What are Workspaces?

Avoid having multiple people making simultaneous changes to a GTM container — the risk of inadvertent errors from misunderstandings and conflicts is high. But if you do have simultaneous groups of changes, attempt to make them in separate GTM workspaces. Click on "Default Workspace," then + to create a new workspace. Your changes are then isolated within that workspace.

Why can't I just hard-code the numeric conversion ID in a tag?

There is a much better way. Use a GA Settings variable to consolidate all configuration parameters in one place, instead of repeating them across multiple tags. Use variables for constants. For example, if you place your fixed Google Remarketing ID value in a variable and reference that variable in your remarketing tags, clicking on the variable will show you everywhere the value is used — which is not possible if each tag contains the numerical ID value directly.

Why can't I just create a bunch of triggers to fire the same tag on different pages?

There is a much better way. Lookup tables can reduce multiple triggers and multiple tags down to single triggers and tags. A lookup table can define the hosts that correspond to your production web site, preventing your vendor conversion tags from firing on development hosts. It can also vary the value of vendor tag IDs by host or page name, so that a single tag can fire with the appropriate IDs that vary accordingly.

How much JavaScript do I have to write?

As little as possible — keep it simple. Do not use custom JavaScript to track scroll activity; Google already does that. Do not use custom JavaScript to track YouTube videos; Google already does that. Do not use custom JavaScript for conversion tracking; Google has many conversion tag templates pre-built for you. The less custom JavaScript, the easier the container is to maintain. If you do need to write custom JavaScript, first check whether known experts like Simo Ahava or Bounteous already have an optimal solution.

Do the CMS developers have to do a lot of coding for me?

Very rarely do you need developers to make changes to a site to facilitate tracking. Everything you need to know is likely already available in the Google Tag Manager Data Layer. Google provides auto event listeners, element visibility listeners, DOM and JavaScript variables, and more — making it possible to capture virtually everything happening on the web site. If there are activities you need that are not yet in the data layer, have the developers add those specific items to it.

What might the CMS developers need to do for me?

You can identify objects on the page through CSS selectors and IDs. However, CSS selectors can be less efficient and less specific than an ID value. If there is a particularly important element on a page to track — such as a thank-you message after a form submission — you can write a CSS selector, or have a developer assign a specific ID value to that element, such as id="thank-you".

What about all these GTM objects from two years ago that I do not recognize?

Ask yourself: Are we still a partner with that vendor? Should we still fire their conversion tag? Is that modal we tracked as an event still on the web site? Has the client lost interest in some tagging added six months ago? Delete obsolete tagging objects to keep the GTM container lean and manageable.

How do I test the container after I publish?

Go to the web site and watch the tags fire. Visit the pages with specific content that was tagged and verify that the tags are firing correctly and as expected.

Are there tools to help me with testing?

A preferred debugging tool is the ObservePoint Chrome plugin. It takes the activity in the developer console's network tab and organizes it in an extremely useful, readable format for tag debugging. GTM also has its own built-in debugging mode, but ObservePoint is a go-to tool for many practitioners.

Is there anything else I should check?

The Google Analytics Real-Time reports will also help you scan the results of a tag implementation for unusual activity that may require your attention.

Any hints for staying on top of all this?

Keep up with advances in tagging and web analytics by following these excellent resources:

Comments

Popular posts from this blog

Site Landing & Site Referrer Preservation

GTM Browser Viewport Measurement

UTM & URL Query String 2 Cookies