Get started with Tag Manager

Google Tag Manager vs. gtag.js

This document is for people who are new to measurement and want to know what tagging setup is the best for them.

This document provides an overview of the Google tag (gtag.js) and Tag Manager. If you are setting up Google Analytics on an app, also see the Firebase documentation.

How to choose the right tagging method for your business

For subtitles in your language, turn on YouTube captions. Select the settings icon Image of YouTube settings icon at the bottom of the video player, then select "Subtitles/CC" and choose your language.


Overview

The Google tag is a single tag you can add to your website to measure website and ads performance. The Google tag is needed to send data to Google Ads and Google Analytics 4 (GA4), also called destinations.

Note: To receive data from the Google tag, you need to accept the Terms of Service (ToS) for the Google service that should receive data.

What tagging option is best for me?

You can either use the Google tag on its own or use Google tag with Tag Manager.

This article explains the different tagging options so you can choose the option that fits your needs.

When to only use the Google tag?

The Google tag is the basis for all measurement use-cases. If you currently use Google Ads or GA4, the product auto-generates a Google tag for you. The next step is to add the Google tag to your website.

The Google tag lets you:

  • Use a single Google tag across your entire website instead of managing multiple tags for different Google product accounts.
  • Automatically measure page views, clicks, scrolls, and more in Google Analytics. Learn more
  • Automatically measure key events and campaign performance in Google Ads. Learn more
  • Configure these Google tag settings from within your Google products (e.g. Google Ads, Google Analytics, Google Tag Manager), minimizing the need to make code changes to your site.

This tagging option is great for marketers who don't have a web development team readily available or use a content management system (CMS). If you only need the default metrics, such as page views, clicks and scrolls, you can set up the Google tag once and you're all set.

Ready to get started?

Need more control?

Consider adding the following tagging options to your Google tag:

  • Google Tag Manager (recommended)
  • gtag.js

What is gtag.js?

gtag.js is a JavaScript tagging framework that allows you to send data from your site to Google measurement products. To set up gtag.js, you add 1 snippet of code to each page of your website. To use the gtag.js effectively, you need to be comfortable changing the code on your site using JavaScript.

Note: The Google tag (gtag.js) can only send data to Google services.

If your tagging needs evolve, you can always migrate your tags to Google Tag Manager at a later date.

What is Google Tag Manager?

Google Tag Manager is a tag management system that allows you to set up and manage tags on your site without changing your website's code. To use Tag Manager, you add 2 snippets of code to each page of your website. After you add the snippets to your code, you don't need to change your code much after that; instead, you can set up and manage your tags through the Google Tag Manager website.

Tag Manager supports Google-specific tags, a wide array of third-party tags, and even custom tags. See all supported tags.

This option is best for marketers who are in charge of tagging and need to manage Google and tags from other parties. It's also a good option for tag administrators, and agencies and can be used in conjunction with site code changes.

Google Tag Manager and gtag.js comparison

The following table highlights the differences between Tag Manager and gtag.js.

gtag.js (code deployment)

Google Tag Manager (Tag Management System)

You need to write code to deploy tags and customize your web collection

Deploy and modify both tags from Google and third-parties on the fly without editing code.
See all supported tags

Can only send data for Google products.

Can send data for Google tags, third party tags, and custom tags.

You need to manage your tags from within your code, and may need to duplicate code for different outlets, for example, web and app.

Manage tags for your website and apps all from tagmanager.google.com

Version control depends on how you manage your code.

Collaborate with others using workspaces, and version control tags.

Server-side tagging is possible. You still need to use Google Tag Manager to deploy and interact with your server container.

Tag Manager allows you to easily deploy tags on a server. If you are currently exploring this option, read Client-side and server-side tagging.

Compatible with static-site generators, CMSs, website builders or manually authored HTML pages that support JavaScript.

Compatible with many CMSs and website builders. If your system doesn’t support Tag Manager, use the Google tag (gtag.js) instead.

Cost: Free

Cost: Free

Ready to use Google Tag Manager?

Set up Tag Manager →

If you already use Tag Manager, continue to do so. Tag Manager fully supports Google Ads and Google Marketing Platform tags, and there is no need to deploy additional code using gtag.js on your site if Tag Manager is already in use.

The Google Analytics: GA4 Configuration tag is now the Google tag

If you were using GA4 configuration tags, they have been automatically upgraded to the Google tag. Your measurement and capabilities will work just as before and you don’t need to take any action.

Your GA4 event tags stay the same.

Next steps

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
8923931656330241221
true
Search Help Center
true
true
true
true
true
102259
false
false