The Google Tag (gtag.js) is a single tag that can act as a bridge between your website and the Google products & services.
For example, you can use Google Tag to send data to Google Analytics 4, where you can see detailed reports on your website traffic and behavior.
It also helps you send data to Google Ads, where you can create and manage your advertising campaigns.
Here, you will learn about every nook and cranny of Google Tag (gtag.js), plus how you can set it up.
Key Takeaways:
Let’s get started with the essentials.
The Google Tag is a messenger for sending your website data to connected ‘destinations’ like Google Ads or Analytics.
As privacy concerns force cookie technologies to evolve, it’s important to have a site-wide tag setup for accurate data flow.
It doesn’t sound like the most significant revelation yet, but here’s the shiniest part of the Google Tag:
Combining multiple Google Tags into one and/or adding multiple destinations to a single Google Tag.
Implementing the tag? That’s the easiest part.
There are countless benefits of using Google Tag. For example:
Some examples of the data that the global site tag can track:
Here’s the basic definition from Google:
“Tag Manager is a tag management system that allows you to quickly and easily update tags on your website or mobile app from a web interface. gtag.js is the JavaScript framework that is used to add Google tags directly to web pages.”
Now, let’s deep dive into it and learn more about these two.
How do you pick the right one? Take a look at the list below and identify your needs.
With GTM, you can;
If you can’t use GTM or prefer to have the functions below, choosing Google Tag can help you:
Adding a Google Tag to your website is as easy as pie.
You just copy the code snippet generated for you and paste it after thetag on every page of your website.
Follow the steps below to find your code snippet and start sending data to Google Analytics 4:
Go to GA4 > Admin
Click ‘Data Streams’, then choose the data stream you want to work on.
Click “View tag instructions”.
Copy the code snippet, then go on to paste it after the
tag on every page of your website.Tracking conversions to see the effectiveness of different ad campaigns is essential for any business. User actions on your website, like purchases, form submissions, or sign-ups, provide valuable insights.
You’ll need to complete 2 main steps to set up conversion tracking using Google Tag successfully.
How to create a conversion action:
Go to your Google Ads account and click the tools icon. Under “Measurement,” find “Conversions.”
In the summary, click “+ New conversion action.” Find the “Website” and click “Next.”
Enter your domain and click “Scan.” It’ll show if your website has the Google Tag or if it doesn’t, the Google Tag code to implement.
It’ll also offer a list of URLs to measure customer actions.
Your next step is choosing the conversion action. You could set up conversions using URLs or manually. Check out our previous guide for a step-by-step breakdown. After completion, you’re ready for the next step.
How to set up the Google Tag:
The Google tag adds website visitors to your “All visitors” data segments and sets cookies in your domain. It’ll allow you to store information about the ad clicks that brought users to your site.
When using Google tag, make sure to comply with GDPR and related regulations and ensure users consent to the tracking.
Choose your preferred installation method:
One more step to go: Checking your conversion tag.
Follow the instructions below to check your conversion tracking tag:
3. Locate the conversion you want to check in the conversion action table. See its status in the “Status” column.
If you encounter any issues, download and use Google Tag Assistant. For Google Tag Manager, follow the Troubleshoot issues document.
While there are many handy plug-ins for the job, it’s possible to add a gtag to WordPress without using one.
First, follow the instructions below:
Go to GA4 > Admin
Click ‘Data Streams’, then choose the data stream you want to work on.
Click “View tag instructions”.
Copy the code snippet here.
Then, go to your WordPress Admin,
Here, you can discover how to set up your Google tag from Google Ads instructions.
Before you get on with the first step, make sure to set up conversion tracking for your website.
You’ll be forwarded to the Google Tag Setup page and presented with these options:
Use the Google tag found on your website (Recommended)
You can use a tag without any code changes if a tag is detected on your website. Click “Details” and view the tag information. If it looks okay, click “Finish.”
Install a Google tag
To manually install a Google Tag, refer to the “How To Add A Google Tag To Your Website?” section of this article. Other options will be covered below as well.
After completing the installation, you’ll need to configure your Google tag settings. Pick the relevant settings for your business.
Set up your Google tag from Google Analytics 4(GA4) instructions just as mentioned above earlier:
You have successfully completed the setup and configured your Google Tag settings. After that, you’ll only need to manage your Google Tag. Let’s cover the options you have.
Manage your Google tag
Follow these steps to complete any of the actions above. Access your Google tag screen:
Access your Google tag screen. In the “Admin” tab, find “Manage your Google tag.”
Here, you can do the following actions:
Combine tags
Once you combine a tag, you can’t undo that.
You can assign a tag ID to a new Google tag covered below. It means creating a new tag using one of the tag ID(s) from the existing tag.
You can choose to have the same configurations for the new tag.
Step 1: Access your Google tag screen. In the “Admin” tab, locate Google tag settings and click “Combine tags.”
Step 2: Click “Choose a Google tag to combine.” This page will list all the Google tags to which you have access. Name the tag you chose.
Step 3: Under “Tag configuration,” select your desired configuration.
Step 4: Click “Review choices,” and if it’s all good, save the changes.
Assign tag IDs to a new Google tag
Assigning tag IDs means creating a new tag using one of the tag ID(s) from the existing tag. You can choose to have the same configurations for the new tag.
First, let’s hear what a destination is, as per Google:
“A destination is a Google measurement product account that shares configuration with and receives data from a Google tag. You can add destinations to your Google tag to reuse your Google tag’s configuration and footprint on your site. Currently, only Google Ads and Google Analytics accounts can be destinations.”
A Google Tag must always have a destination to send accurate data flow. You can add destinations to avoid additional retagging on your site and reuse your existing tag’s configuration.
If you add a destination, you actively remove the destination from another Google Tag that has it.
It’s useful to add destinations when sending data to another product account without combining Google tags.
For instance, let’s say you’re working with an agency that uses its tag to send data to your account. You can add the destination to your Google tag instead.
Here’s how you do it:
Step 1: In your Google tag screen, go to the “Admin” tab.
Step 2: Find the “Google tag management” section, and click “Manage Google tag.”
Step 3: In the “Destinations” section, click “+Destination.” Move forward with the “Choose a destination” option.
Step 4: Choose a destination to add to your Google tag. Find the destination you want.
Step 5: Review your updates, and click “Save.”
Step 1: In your Google tag screen, go to the “Admin” tab.
Step 2: Find the “Google tag management” section, and click “Manage Google tag.”
Step 3: Under “Destinations,” find the one you want to remove and click the “Remove destination” icon.
Step 4: On the “Remove a destination” screen, click “Choose an existing tag” or “Create a new tag.”
Note: If you deleted a tag or destination more than 30 days ago, you will see a “No tag ID” error message because the tag has no destination attached.
When you open the Google tag section, you’ll see the options to add a destination to a new Google tag or an existing one. You can restore your destination by adding it to an existing Google tag or creating a new one.
View your tag destination
Conflicting on-page code
Your Google tag processes on-page gtag() commands to load and configure settings for your Google tags.
Duplications or inaccurate settings may occur if the same Google Tag is configured multiple times on the same page.
You can ignore duplicate instances of on-page config commands by enabling the option “Ignore duplicate instances of on-page configuration” in the “Manage Google tag” section.
When you combine two Google tags, this option is enabled automatically.
You have a couple of options when it comes to installing your Google Tag with a website builder or CMS. Here are some more insights:
As you know, your tag ID starts with “AW-” or “G-“. For now, we need to follow separate steps for Google Tag Setup on Shopify.
If your tag starts with “G-“
Step 1: Navigate to Sales channels > Online Store
Step 2: Under “Online Store,” find “Themes.” Here, click on the “Actions” dropdown menu and select “Edit code.”
Step 3: Select “{/}theme.liquid.” under “Layout” Make sure there aren’t any tracking tags in this file.
Step 4: If you have any ga.js, gtag.js, or analytics.js files listed, it means you’ve installed Google Analytics. Verify this installation’s accuracy before making any changes.
Step 5: Locate the file’s closing head tag (</head>) and paste the Google Analytics code above it. Click “Save.”
If your tag starts with “AW-“
Add the Google Channel app to your Shopify account.
Verify your email and Google account details
Now, we need to confirm that the correct Google account appears when you visit the “Google Ads account” section of Shopify.
When the accounts are linked, the following conversion actions will be created automatically in Google Ads:
For Woocommerce, we’ll follow the same logic for different tag IDs. The ones starting with “AW-” are usually Google Ads accounts. And those beginning with “G-” are usually Google Analytics properties.
For Tag IDs starting with AW-
If you have a tag ID starting with “G-”
The evolution of Global Site Tag to Google Tag points to Google’s solid attempts to address privacy concerns while streamlining the tag management process. Its features, like no-code ad conversion tracking and working with multiple destinations, will surely come in handy for many marketers. Still, Gtag users don’t need to rush to switch. But it’s essential to keep an eye out for all Google Tag updates.