Google Tag Manager Tags Explained: A non-technical guide.
Over the past 2 weeks, we have talked about the GTM Data Layer, how to implement it, and how to use it in GTM. Additionally, we have explained the different types of GTM Variables, how to use them, and how to create them.
?? Now let's try simplifying another part of Google Tag Manager ?? Tags!
The official definition of Tags is: A tag is code that sends data to a system such as Google Analytics [Reference]
The definition I prefer: Something you use to track specific events. yeah, that's it ??
How Do Tags Work?
Let’s break it down with examples:
Let's say that you have a website and you want to track an event when someone views a product ?? You will need to create a Tag to track that event.
Let's say that you have a website and you want to track an event when someone adds a product to the shopping cart ?? You will need to create a Tag to track that event.
Let's say that you have a website and you want to track an event when someone views a collection page ?? You will need to create a Tag to track that event. [You got the idea]
Meaning that Tags are Events, that's another way of thinking about tags!
Types of Tags:
There are many types of tags, but I’ll focus on the most frequently used ones. You can explore the rest on your own!
(The below terms are something I prefer to use, you will not find them anywhere)
Go to the Tags Section within GTM ?? Click New ?? Click on the 'Choose a tag type to begin setup' space (step 1 from the above image)
You can choose a featured tag like Google Analytics or Google Ads. (Supported/Native)
You can also hit the Template Gallery option. (I call these Community Created)
When you want to track an event, ask yourself 2 questions:
Luckily, we can see that there is a featured tag template for Google Analytics that we can use, let's click on that:
Now we'll see that we have this interface that asks us to input 2 things, GA4 Measurement ID & The Event Name.
领英推荐
If you're not familiar with that I highly recommend hovering above the question mark for each field as it will give you a description of what to add in the field and where to get that information. Also, note that each tag template will ask you for different inputs. They are not all the same.
Your measurement ID will look something like G-1234456 and for Event Name, let's use view_item as this is the value we want Google Analytics to store the events in as an event name inside GA4.
Lastly, give your Tag a name as it will be named 'Untitled Tag' by default, That name will be used on the GTM interface only, it will not affect the events you configured nor the data you collect.
I recommend using a unified naming convention that includes the event name and destination so it's clear for you and your team members to understand all tags quickly and clearly. It will also come in handy in the future when the container gets bigger.
For our example, we can use something like GA4 - View Item.
Bonus Points (Optional)
Let's quickly apply what we have discussed in the Data Layer & GTM Variables articles by applying what we learned.
We created a Datalayer variable called dlv - product page - item name in this example that returns the Item name.
Now in the same tag we just created, in the event parameters section, add a parameter called item_name, on the other side, past the variable name:
A parameter is a piece of information that is included within the event.
Think of it like that: by creating the tag initially, we're telling GA4 to listen for the view_item event, by adding this parameter, we're also telling GA4 to capture the item name value (The variable we created and added) and to show the data under the view_item parameter that we added in the above example.
So when we look at our GA4 reports we can see how many times users viewed items on our website and what was the item name!
Custom HTML Tags
Now what if the destination we want to send the event to does not have a built-in template like Google Analytics? Let's take Facebook/Meta for example since they don't have a Native template that they created.
We can use Custom HTML Tag: A custom HTML Tag is the raw event code that the destination requires you to use to fire the event, Typically that code is provided from the destination or they provide documentation on how you can create it [example]
Let's say that we have followed the above guide and we are trying to fire a pageview event for the Facebook Pixel, you can copy that code and create a custom HTML tag in GTM, it will look something like this:
Some events will require you to send additional details inside the events (parameters), in this scenario they might provide a code like the below example and ask you to make sure to use dynamic variables for the parameters, you can use any variable you want by simply opening 2 curly brackets {{ variable name }} note that you should add the exact name between the curly brackets without any additional space and that's it, you have added the parameter successfully!
<script>
fbq('track', 'ViewContent', {
item_name: {{dlv - product page - item name}}
});
</script>
You can also see if someone has created a Tag Template for the destination, in our case, When we search the template gallery, we can find this tag template to use for firing the Facebook Events:
Just make sure to test it, check how it works, and see if it's trustworthy.
I hope you find that helped you understand Google Tag Manager tags in a simple non-technical way :) Stay tuned for the next article where we'll go through how Triggers work and how to use them in Google Tag Manager ?
Helping Non-Technical Users Master Web Analytics
4 个月Video: https://youtu.be/-qakI7PsK2c