When should you use Google Tag Manager? Here are some examples and tips on how to set it up.
Google Tag Manager is a tag management system that includes the same functionality as global site tags, and lets you configure and instantly deploy tags on your website or mobile app from an easy to use web-based user interface.
Once you install the Google Tag Manager container on your site, everything you do on GTM will be contained within that code snippet. In other words, the code on your site – the GTM container – doesn’t change, yet at the same time, that container will push any updates made in Google Tag Manager to your website.
OK, but what are tags?
Tags are segments of code provided by analytics, marketing, and support vendors to help you integrate their products into your websites or mobile apps. With Google Tag Manager, you no longer need to add these tags directly to your projects.
One product that integrates nicely with Google Tag Manager is Google Analytics. Google Analytics, as you probably know, is a great way to track user behavior on your website. But not everything you want to track in GA is included by default.
Newsletter Sign-Up Example
What if you want to track every time someone clicks a “SIGN UP” button on your website for newsletters? Google Analytics can’t recognize when that happens without some help. There are two ways you could make sure that user action is tracked in your GA dashboard.
1. You could edit the code on your site and insert an event using gtags. This is a little more complicated and would require the help of a programmer.
2. You could create a tag in Google Tag Manager that “fires” every time someone clicks the “SIGN UP” button, which would then feed data into Google Analytics. No coding changes required.
Once you’re tracking those signups with GTM, data will begin to feed into your Google Analytics dashboard. From there, you can create a “newsletter sign-up” segment in the Metrics for News app that will track the behavior of users who recently subscribed. This will allow you to better understand the behavior of users who recently signed up for the newsletter, and tailor your on-site strategy to attract even more subscribers.
You can apply this example to other situations such as new account sign-ups, signed-in vs. signed-out users, subscribers vs. non-subscribers, and more. As long as it can be tracked with GTM, we can get the data into your MFN app.
Creating a Tag on GTM
There are three components to sending an event to your Google Analytics dashboard using Google Tag Manager: Variables, Triggers and Tags.
- Variables are information such as “Click Text” or “Page URL” that can be contained in both Triggers and Tags.
- Triggers are essentially the domino that, when fired, tells the Tag what information to pass along.
- And the Tag is the vehicle by which information is sent to Google Analytics.
Let’s make this a little more clear by using our example of newsletter signups: If your signup button does in fact say “SIGN UP”, then that’s probably your Click Text. (You’ll have to double-check this on the backend of your site, but for our purposes, we’re going to assume that’s the case.) You would then create a “Click: All Elements” Trigger that’s activated every time someone clicks the SIGN UP button.
The final step would be to create a Tag connected to the aforementioned trigger. When that trigger is fired – when the user clicks on the button – the tag will contain the information that’s sent to Google. For Universal Analytics, there are four Event Parameters that can be configured to show up in your UA dashboard: Category, Action, Label, Value. You can only fill in one of these if you want, but we usually recommend filling in the first three, and the fourth one if there’s a monetary value attached to your event.
You might choose the following configuration for this tag:
Category: Click
Action: Sign Up
Label: Newsletter
Value: [N/A]
You would then be able to find information related to each of these parameters in the Behavior > Events > Overview dashboard of Universal Analytics.
How does this work with Google Analytics 4?
Your Metrics for News dashboard is still powered by Universal Analytics (unless you use Adobe) and not Google Analytics 4. That being said, you should still have GA4 set up and collecting data for when UA is shut down July 1, 2023.
Nevertheless, the GA4 dashboard is vastly different from UA, but the GTM tag process is similar. Both the variables and triggers function the same way. In the tags, you now choose an event name instead of filling in the four event parameters mentioned for UA.
In GA4, there are five event parameters included by default, and you can add up to 25 additional custom parameters.