Learn how to find your G-tag and install it on your site for the most up to date tracking
Tracking Tips Thursday - Everything You Need to Know About Google's G-tag
Shaun Elley
If you're just starting out with your website or have been running it for a while, you might have heard about the Google Tag (gtag.js) and are wondering whether you need to install it on your site. Whether you're setting things up for the first time or looking to update your current tracking, this blog post will answer your questions: What is Google's g-tag? Do you need to install it on your site? And if so, how can you do it?
In this post, we'll explain what the g-tag is, why it's important, and how you can easily implement it to future-proof your website's tracking and analytics setup. Whether you're using Google Analytics, Google Ads, or other Google services, the g-tag streamlines your tracking with a single, unified tag.
First of all, what is it?
The g-tag is now Google’s all-encompassing tag. It provides data to Google Analytics, Google Ads, Google Campaign Manager 360, and Google Merchant Center. Instead of adding a tag for each service like was previously required, this single tag and ID will be able to work for all those services plus any future service Google offers (most likely).
The benefits are
It is easier to set up and manage (1 tag instead of 4)
In many cases, it provides an easier way to deal with user consent and ever-evolving laws and regulations around user consent.
If the future is cookie-less, the g-tag will hold up and conversion tracking will not require cookies
Google claims it provides more accurate conversion tracking
So what’s the downside?
Well, to be frank, there isn’t much of a downside. It is fairly easy to install whether you have Google Tag Manager (GTM) or are having to hard code on your website directly. If you currently have conversion tracking (either through GA4 or Google Ads or both) you might feel that you don’t need to fix what’s not broken. However, given how simple it is to install the code, I would argue that the few minutes it takes to set up the tag would be worth it. After all, two of the benefits above are about preparing for possible future problems & legislation changes (plus who knows when Google will just depreciate the other tags).
So to quickly sum it up, if you don’t have any tracking yet - install the g-tag on your site. If you have tracking set up and are happy, just block off 10 minutes in the next few months and get it installed on your site to future-proof your data.
How to add the g-tag through GTM:
First, head to your Google Ads account, select the tools from the left-hand navigation, and then select “Data Manager”
You should now see your Google Tag in the middle of the screen. Select “Manage”
After selecting manage, you will now see your ID below your ad account name. Copy that ID
Now head to Google Tag Manager (GTM). Select “Tags” from the left-hand navigation and then click the “New” button at the top right of the page
You can name your tag something simple like “Your company Gtag” Select the “Google Tag” option it should be in the first section of tags but if you don’t see it you can search for “Google tag”
After selecting the Google Tag you will need to paste in the ID that you copied out of Google Ads. Then you want that to tag to trigger/fire on all pages so add “all pages” as your trigger
If GTM is not set up on your site and you are looking to set up the G-tag directly into the code on your website you will follow the same steps as above to find the G-tag in your Google Ads account and then you will add the following code directly after the <head> tag on every page of your site replacing the “tag_id” sections with the ID you pulled out of Google Ads.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TAG_ID');
</script>
How to Find G-tag in GA4
Finally, if you don’t have a Google Ads account but want to set up tracking via the G-tag for your GA4 property. Here is how to find your G-tag in GA4.
Select the admin icon (cogwheel) on the bottom right of any page in GA4
Select Data Streams from the right side of the admin home page
Assuming you only have 1 data stream in your account, select the carrot on the right side of that stream. If you have multiple streams (if you are tracking an app as well in most cases) you will select the stream for the data you want to track with the g-tag (your website in most cases).
Your measurement ID is your g-tag ID (I am not sure why they don’t call it that in GA4). So you can click the copy sign to the right of the ID starting with G- and then follow the steps above to either add it through GTM or hardcode onto your site.
Now that you have added the g-tag to your site, you should start seeing data come through in either your Google Ads account or your GA4 account. The next step will be setting up those very important conversions so you can know if your marketing efforts are driving the traffic and results you are looking for.