Global Site Tag: What is it, and how does it affect your revenue?

Table of Contents

Tags are used on websites to send information to third parties such as Google. They collect data, track ads, and target your ad campaigns and other functions. It's a snippet of Javascript that you add to the site, and a Global Site Tag (gtag.js) allows you to manage multiple products with just one piece of code. We explore the Gtag and explain why you should have one on your site and how it works.

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. 

The Google Tag Manager has a user-friendly interface that supports advanced functions, but Gtag is purely driven by Javascript installation for advanced tracking. Nevertheless, it's relatively easy to use, and you could likely install the tracking codes yourself without a developer. 

You can also send data to your Analytics account using an Analytics tag, which is also a snippet of Javascript. You can use this particular tag directly on the HTML of each site page or through Google Tag Manager or another tag management system.

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:

Google Site Tag

*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

  1. When you set up the tag in Google Ads, choose the “Install the tag yourself” option.
  2. In the “Global Site Tag” section, generate the code based on your option.
  3. Copy the gtag.js.
  4. Open your Shopify admin panel and click on “Online Store.”
  5. Click “Actions” then “Edit code.”
  6. On the left-hand side, click on “theme.liquid”.
  7. Paste the copied Gtag between <head><head> tags to apply the snippet to every page on the website.

Pro tips:

  • Make sure there are no extra spaces before the code. You can use the tag assistant to check if the code is correctly inserted.
  • Remember that Google Ads doesn't allow using tags on pages with policy-restricted offers.

Configuring the Gtag for Google Analytics

Follow the instructions below to add your gtag.js for Google Analytics to your website.

  1. First, log in to your Google Analytics account.
  2. On the left-hand side, click on “Admin.”
  3. Select an account from the drop-down menu of the left column called “Account.”
  4. Select a property from the drop-down menu of the “Property” column.
  5. Click on “Tracking info,” then “Tracking Code.”
  6. You'll see your website's unique tracking ID, starting with a UA, shown at the top of the page. 
  7. Copy the gtag.js.
  8. Paste the snippet right after the <head> tag on each website page you want to track in GA.
  9. 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. 

The Gtag, as mentioned above, is a sitewide Javascript API and tagging framework that sends data to GA. To install it onto your website, copy the following code and paste it after the <head> tag on every page of the site. 

The Global Site Tag is a JavaScript tagging framework and API. It allows you to send event data to Google Analytics. To install the gtag.js, you must copy the following code and place it after the <head> tag on each website page. 

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.

Global site Tag

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.

Common questions:

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?

You should switch to Global Site Tag (Gtag) if you have experience in Javascript and want to install the tags without fiddling with a tag management system. On the other hand, the GTM is useful if you want the freedom to set up or modify your triggers and events within a web interface and if you don't know hard coding or scripts.



Graphic object waves
Graphic object lines
Get the free Product Page Mastery course and increase your conversion rate from 1% to 7%.

Book your FREE strategy call with Sam

Table of Contents

Graphic object Triangle
Notify of
Inline Feedbacks
View all comments
Sam single blog pages

I hope you enjoy reading this article.

If you want us to help you scale up your ecommerce business, book a free strategy call.