This document is for people who are new to tagging 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
.
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
.
What tagging option is best for me??
You can either use the Google tag on its own or use the 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 update your website code.
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 conversions 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 one of the following tagging options to your Google tag:
- Google Tag Manager (recommended)
- gtag.js
What is gtag.js?
The Google tag uses the
gtag.js
JavaScript framework to add Google tags directly
to web pages. To use
gtag.js
effectively, you need to be proficient in HTML,
CSS, and JavaScript.
This tagging option is best for web developers who are in charge of tagging and
only need to manage Google tags.
gtag.js
lets you install tags directly on
your web page, without the ramp-up time of setting up a tag management system.
If your tagging needs evolve, you can always
migrate
your tags to Google Tag Manager
at a later date.
What is Google Tag Manager?
Tag Manager is a tag management system that allows you to quickly and easily
update
tags
on your website or mobile app from a web interface. You can use
Google Tag Manager to load a Google tag on your website. This method is equal to
adding the Google tag code snippet to your site.
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 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 and install 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.
Next steps