What is a Global Site Tag used for?
The gtag.js is a single tag you add to your website to use the various Google products and services. It used to be that you would need several tags on your site for different products, but the Gtag allows you to manage them all with one piece of code.
It works with products such as Google Ads, Google Ads Campaign Manager, Google Analytics, Google Analytics 4, Display & Video 360, and Search Ads 360. The Gtag must be added to every page right after the <head> tag.
Sitewide tagging tools
A tag is only one of the sitewide tag solutions; others include the Google Tag Manager and Google Analytics using a Global site tag.
The Global Site Tag (gtag.js) and the Google Tag Manager (GTM) will allow you to send tracking information to your Google Ads or Google Analytics Account. There are, however, a few distinct differences between the two.
The Gtag is only compatible with Google products, while the Google tag manager is compatible only with third-party products. In addition, the Google Tag Manager allows for more functionality, such as the testing of codes and version control. In contrast, the gtag.js is limited in functionality but easier to implement.
What does a Gtag look like?
A Global Site Tag is several lines of code that you need to add to each page of your website. Here is an example of what the gtag.js looks like:
*If you set up Analytics on your site after August 2017, your site is probably tagged with gtag.js.
*If you set up Analytics on your site before August 2017, your site is probably tagged with analytics.js.
When should you use a Global Site Tag?
A Global Site Tag is helpful in two instances; remarketing and conversion tracking. Use a Gtag to set up an audience source and reach people who have been to your website or used your app. The code allows you to add website visitors to your data segments which let you target ads to these visitors.
The tag works in conjunction with another piece of code, phone snippet, or event snippet to track your conversions. The event snippet tells the site tag when it should track a conversion. The phone snippet works similarly but replaces your business number with a Google forwarding number.
The benefits of using a Global Site Tag
Implementing a Gtag across your website gives you access to several additional benefits and enhancements.
- A site tag will equip you to continue measuring conversions accurately if future changes occur.
- It gives you codeless tag management by not having to change the tags on your page manually.
- The Gtag is streamlined and easier to implement, with smooth integration with other Google products.
The Global Site tag provides more accurate conversion data when cookies aren't available. It also helps to recover conversions not observed today due to industry-specific factors.
Where should the Google Ads Gtag be placed?
You must add the Gtag snippet on all your web pages in your HTML's <head> section. Some themes have a special place dedicated to such code snippets. In Shopify, you need to place it in the Theme.Liquid section.
How to install the Gtag in Shopify
- When you set up the tag in Google Ads, choose the “Install the tag yourself” option.
- In the “Global Site Tag” section, generate the code based on your option.
- Copy the gtag.js.
- Open your Shopify admin panel and click on “Online Store.”
- Click “Actions” then “Edit code.”
- On the left-hand side, click on “theme.liquid”.
- Paste the copied Gtag between <head><head> tags to apply the snippet to every page on the website.
Configuring the Gtag for Google Analytics
- First, log in to your Google Analytics account.
- On the left-hand side, click on “Admin.”
- Select an account from the drop-down menu of the left column called “Account.”
- Select a property from the drop-down menu of the “Property” column.
- Click on “Tracking info,” then “Tracking Code.”
- You'll see your website's unique tracking ID, starting with a UA, shown at the top of the page.
- Copy the gtag.js.
- Paste the snippet right after the <head> tag on each website page you want to track in GA.
- Locate the following text: GA_TRACKING_ID and replace it with the unique tracking ID provided by GA.
If you plan to use remarketing or audience demographics, then go to the “Data Collection” link and make sure that the “Remarketing” and “Advertising Reporting Features” boxes are set to “On.”
For ecommerce websites, there are another two features that need to be enabled – “Ecommerce settings” and “Ecommerce reporting.”
- First, click on the “Ecommerce settings” link.
- Then, on the ecommerce set-up page, slide the “Enable ecommerce” bar to “On.”
- Next, do the same for the “Enable Enhanced Ecommerce Reporting.”
- Then click on “Save.”
These settings ensure that you're tracking your conversions and other relevant metrics.
Replace the highlighted section below, with the ID of the GA property to which you want to send data. You only need one code snippet per page.
Where can I find the Global Site Tag for Google Ads?
Log in to your Google Ads account and navigate to the
Tools and Settings > Shared Library > Audience manager > Your data sources> Google Ads tag.
I already have GA, Facebook Pixel, and another tracker installed on my landing page. Do I need to replace it with the Gtag?
You don't have to replace Google Analytics or the other tracker with the Global Site Tag Manager. It's actually better if you don't duplicate and install GTM or Gtag if you already have these installed, as it could cause issues with reporting.
Should I use Global Site Tag or Google Tag Manager?