The global site tag (gtag.js) is now the Google tag. Learn more

Overview

To use measurement and advertising products such as Google Analytics, Ads conversion measurement, remarketing, and more, you add Google tags to your website. You can write tags in JavaScript, using the Google tag, or add them with configuration, using the graphical Google Tag Manager user interface. Tag Manager supports both websites and mobile apps. If you use Firebase to build mobile apps, an API is available to provide the required information to Google measurement and advertising products.

What is a "tag"?

What is the Google tag?

What is Google Tag Manager?

In Google documentation, Google tag examples consist of gtag.js code, while Tag Manager examples provide steps to configure tags.

Usage example

The following example illustrates the difference between use of the Google tag and Tag Manager.

This Google tag shows a snippet that you could add to each page of your website. The tag ID in the snippet enables measurement for Google Analytics and Google Ads.

<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>

To use Tag Manager to enable measurement for Google Analytics and Google Ads, you can enable the same functionality as the above example by configuring a tag in the Tag Manager user interface and publishing it with one click to all pages of a website. See Google Ads conversions to learn more.

Tags supported by Google tag and Tag Manager

The Google tag (gtag.js) and Tag Manager provide the following tag support:

Tag Type gtag.js Tag Manager
Google Analytics 4 Yes Yes
Google Analytics: Universal Analytics Yes Yes
Google Ads Conversions Yes Yes
Google Ads Remarketing Yes Yes
Floodlight Yes Yes
Google Optimize Yes Yes
Google Surveys Website Satisfaction No Yes
Third-party tags No Yes

In addition to the Google measurement products listed here, Tag Manager supports a wide variety of third-party tags. The Community Template Gallery contains additional tag and variable templates maintained by third parties. You can also create and share your own tags with custom templates.