What is GTAG?

What is GTAG?

gtag or Google tag is a single code (gtag.js) deployed across a website that collects and sends data to all the Google destinations (GA4 and Google Ads)

By: Mussarat Nosheen | 4 mins read
Published: Dec 6, 2023 3:59:08 AM | Updated: Feb 23, 2024 10:32:25 AM

Have you recently tried to create a new Google Analytics 4 property, finding yourself staring at gtag or Google Tag Manager options to do so?

Some people find this pretty confusing. 

Like which is which? Deciding if one is better than the other can also be challenging. 

As cookies are fast becoming a thing of the past, businesses rely on tags to collect the data they need to send to their GA4 properties for in-depth analytics. 

Hang on to your seats as we explain what a gtag is and whether or not you should use it. 

What is Gtag?

Google tag or gtag is a single JavaScript tag (gtag.js) deployed across the website to track website and ad performance in Google Ads and Google Analytics 4.

A tag is a small piece of code collecting information from web pages. 

So, when you use a gtag, instead of installing and deploying multiple tags for various Google products, you rely on gtag alone.

It will collect all the relevant information and send it to the destinations (Google Ads and Google Analytics 4). 

Finally, for those of you who might be wondering if gtag is an upgrade on the Google Analytics configuration tag (analytics.js), it isn’t. 

I mean it is pretty obvious, isn’t it? GA configuration tag is limited to GA alone. Gtag, on the other hand, supports an increasing list of Google products

How to Use Gtag?

Google tag makes your life easier by removing the need to maintain several tags to keep track of your performance on multiple products. 

You have to do three things to use gtag.

  • Find Your Google Tag ID
  • Install the gtag on Your Website
  • Configure gtag
  • Verify Your gtag is Working

Let us go over each of these one by one. 

Find Your Google Tag ID

A tag ID is an identifier added to the website to load a tag. 

You follow different steps to find your gtag ID on Google Ads, Google Analytics 4, and Google Tag Manager.

Find Your Google Tag ID in Google Analytics 4

To find your gtag ID in GA4, follow the steps below. 

  • Go to Google Analytics 4 > Admin > Data Streams.

Find your gtag ID in GA4 by going to Data streams

  • In Data Streams, click a stream to view the Web stream details

Click a web stream to view Web stream details in GA4


  • In the Web stream details, scroll down to Google tag and click Configure tag settings.

Go to Google tag in Web data stream details, then Configure tag settings to find gtag ID in GA4

  • The Google tag tab will open. Copy the gtag from Your Google tag.

Google tag Configurations


Find Your Google Tag ID in Google Tag Manager

You should already manage a Google Ads, GA4, or Google tag in a container to find the gtag ID in Google Tag Manager

  • Go to Google Tag Manager > Google Tags

Go to Google Tags to find your gtag ID in GTM


  • You may copy the gtag ID directly here or click the relevant tag to open the tag configuration tab and copy from there.

Find Your Google Tag ID in Google Ads 

You must have set up conversion tracking in Google Ads before installing the gtag via Google Ads

Follow the steps below to find your gtag ID in Google Ads

  • Go to the Set up a Google tag page.
  • You will find three options for setting up your Google tag, one using the Google tag found on your website, using a different Google tag, or installing a new one.
  • To set it up using the gtag found on your website, simply choose the first option and install it with Google Ads as you follow the instructions.
  • For the remaining two options, you will receive a code and the relevant instructions to install the gtag on your website. 


You can set up Google tag without using a code if you install it using a CMS or website builder. 

Install the Gtag on Your Website

Now that you have your Google tag ID it is time to install it on your website.

  • Paste the gtag ID copied in the previous section (no need to do so if setting up using Google Ads) in the sample code below. 


<!-- Google tag (gtag.js) -->

  <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>


    window.dataLayer = window.dataLayer || [];

    function gtag(){dataLayer.push(arguments);}

    gtag('js', new Date());


    gtag('config', 'TAG_ID');


  • Now go to your website and paste the above code with your gtag ID on every web page you wish to track. 

Configure Google Tag Settings

Once you install gtag on your website, configure it to send user interaction data to destinations. 

  • Go to Google tag settings and click Show all to see all the available tag settings. 
  • It has eight options. Go through these, one by one, and configure the settings relevant to your website. 

Verify Your Gtag is Working

It is time to verify if your gtag is working and sending data to destinations.

  • Go to Tag Assistant and enter your website URL to verify.
  • If it shows your Google tag ID in the Google tags found, your gtag is working.
  • Debug in tag assistant if your gtag ID does not appear.

Once your gtag is up and running, it collects user data, their interaction and the actions performed on your website, and ads to destinations. 

What is the Difference Between Gtag and Google Tag Manager?


Google Tag Manager

A single JavaScript code to track user behavior and send data to all Google destinations.

GTM is a tag management solution that less technical people can use to create and install tags.

Exclusively used for Google products like Google Analytics 4 (and its paid versions) and Google Ads

It manages tags for Google products and other tools like Facebook pixels.  

Since gtag is a code snippet, one must have coding knowledge to edit it. 

GTM is a central location to create and manage your tags and involves dealing with user-friendly templates. 

Gtag must be written and deployed by a coder. 

Offers access controls to allow marketers to create tags, and the coder can review them before publishing them. 

When Should You Use Gtag?

Google Tag Manager is a better option than gtag because it is simpler, easier, and does not require a lot of technical skills.

So, marketers can go on to create variables and triggers, then create a tag and link the trigger to fire up the tag every time a user performs a specific action.  

A developer can review and publish the changes in GTM to ensure it is technically sound. 

But there are times when using a gtag is preferable to GTM

  • When it is a technical person dealing with the website and its codes, they appreciate directly writing codes into the event library to trigger the tag
  • Someone (again, a coder) looking for more control of the tracking codes (tags), preferring non-interference from the marketing staff. 
  • When the setup of an entire project is in gtag; and it relies on extensive customized coding in gtag. Transferring it into GTM can become time-consuming and costly; therefore, not feasible. 


Gtag is a single JavaScript code that collects and sends data to Google products Google Analytics 4, and Google Ads to track the performance of your website and ads.

It is a code snippet that goes into the header code of all your website pages that you wish to track and monitor.

To use gtag, one needs to find their gtag ID, add it to the header code of all pages of their website, configure it, and verify it is working. 

Gtag has several differences from Google Tag Manager. The former is a code, whereas the latter manages tracking codes (tags). 

Gtag is technical, offers more control, and supports only Google products.

GTM on the other hand needs less technical capabilities, allows user access controls, and easy handling. 

In some situations, however, gtag is preferable over GTM. 

Like what you read? Learn more about Digital Analytics in our blog here.