Google Analytics

Google Analytics – New Global Site Tag Offers Unified Google Product Tracking

Google is releasing a new implementation method, called the Global Site Tag (gtag.js). The goal of this method is to streamline tracking across Google products, including their “measurement, conversion tracking, and remarketing products.” For now, based on an early look at the library itself, this seems to include Google Analytics, with a structure in place that will soon support AdWords and Firebase tracking.

This feature will be a beta rollout, first impacting only a percentage of accounts. It will have no impact on existing accounts and no code migration is required.

Something interesting about gtag.js is the way it handles event tracking. All you need to do is pass an event name to gtag.js, for instance:

gtag('event', 'login', {'method': 'Google'});

Is recognized by gtag.js as one of their “automatic events” and is assigned these values for category and label:

Category: engagement (based on the ‘login’ event name; an event named ‘refund’ would have a default Category of ‘ecommerce’)
Action: login (pulled from the event name)
Label: Google (pulled from the ‘method’ parameter for login events only)

This is much more in alignment with the way that Google Analytics for Firebase works, so this showcases the intended unification across these Google products. Here’s a handy reference for default GA categories and labels using the gtag.js method for event tracking.

Also, there is a mechanism allowed for customizing Category and Label still:

gtag('event', 'login', {
  'event_category': 'access',
  'event_label': 'Google'
});

So you can still have whatever Category, Action, and Label you want.

You can also send your own custom event and parameters. We know how this would translate into a Google Analytics for Firebase report, but it is unclear today in the documentation on how this will impact Google Analytics. We’ll just have to try it and find out! 🙂

For example, from Google’s documentation:

gtag('event', 'video_play', {
  'video_title': 'My promotional video',
  'duration': '01:32',
  'non_interaction': true
});

Should I migrate my tracking setup?

Some veterans of the Google Analytics world, especially agencies supporting many clients, will remember the migration from “classic” Google Analytics (ga.js) to Universal Analytics (analytics.js) like a bad dream. Even further back, there was a migration from urchin.js to ga.js – Urchin being what Google Analytics grew from after Google purchased the Urchin company. In both cases, it was a sizeable effort for clients to migrate all of their custom tracking to a totally new code syntax.

While it is true that the Global Site Tag comes with a new syntax as well, it doesn’t require you to retag your site. This is because nestled within gtag.js is the Universal Analytics analytics.js. The functionality is completely the same.

When Google releases large updates like this or deprecates a feature, I also like to remind people that even though Urchin was discontinued in 2012, Google’s hosted urchin.js library is still accessible and so are all of Google’s help center documents for Urchin. It is even still referenced in several developer docs in use today, like this one. The point is, Universal Analytics (analytics.js) is likely to continue to work for you for a long, long time.

Google’s documentation does mention that “you will be able to benefit from the latest dynamic features and integrations” by using gtag.js, so it is possible that there will be some features available in the future for gtag.js but not analytics.js. However, these features seem likely to be focused on streamlining efforts across products and not an expansion of Google Analytics capabilities, which may still be concentrated in analytics.js. We will learn more as gtag.js is expanded in the future.

How do I know if I should use this tag?

If you are a new Google Analytics user who is not interested in a tag management system like Google Tag Manager, you may want to use the Global Site Tag to simplify your data across Google products like Google Analytics and AdWords.

If you don’t want to use a tag management system and you don’t want to send data to multiple Google products at once, you can still use the analytics.js library for a new implementation. Just look below the Global Site Tag implementation instructions in the UI to get started with an analytics.js implementation.

If you are an existing Google Analytics user and are satisfied with your Universal Analytics library on its own then there is no need to migrate.

The Global Site Tag is not a replacement for Google Tag Manager. Google Tag Manager, like most tag management systems, enables you to manage tags beyond the Google suite of products, such as Facebook conversion pixels or heat mapping tool tags. Google Tag Manager also offers features to manage tag governance such as version control, workspaces, and environments. Google Tag Manager 360 clients can enjoy the approval flow features for more advanced tag management.

A few important callouts…

The Global Site Tag is still in beta. While it is in beta, it is not covered by SLA. This has been true historically of Google beta offerings.

The Global Site Tag also does not support Content Experiments, Tasks, and custom plugins. If you are interested in Content Experiments you might consider looking at the more sophisticated Google Optimize and Optimize 360, both of which offer a WYSIWYG editor, multivariate test capabilities, and the ability to still run a redirect test if desired. We say “good riddance” to Content Experiments. 🙂

For the code curious, you can compare the Universal Analytics analytics.js library and the new Global Site Tag gtag.js library at your leisure. The gtag.js library pushes data to the Universal Analytics analytics.js library and will soon include others such as the conversion.js (AdWords).

Stay tuned for more updates. Meanwhile, if you have any questions about the new tag or need help migrating, please contact us.

Tara Kincade

Tara is Director of Data Engineering on Cardinal Path's Data Science team. She focuses on advancing clients' capabilities by solving their challenges in data integration and transformation. With a deep background in consulting across a variety of verticals and platforms, Tara is often a heavily relied upon resource to bridge communication gaps and unlock technical barriers.

Share
Published by
Tara Kincade

Recent Posts

Optimizing user experiences with Digital Experience Analytics (DXA) platforms

As consumers become increasingly digitally savvy, and more and more brand touchpoints take place online,…

1 month ago

Enabling Value-Based Bidding with Google Tightlock

Marketers are on a constant journey to optimize the efficiency of paid search advertising. In…

1 month ago

Resolving “Unassigned” Traffic in GA4

Unassigned traffic in Google Analytics 4 (GA4) can be frustrating for data analysts to deal…

2 months ago

This website uses cookies.