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. Learn more about Google Tag Manager.
If you’re using a website builder or CMS like Wordpress, Shopify, or Wix, learn how to Install your Google tag with a website builder or CMS.
On this page
- Before you begin
- Where is my Google tag ID in Google Tag Manager?
- Set up your Google tag in Google Tag Manager
- Next steps
Before you begin
If you already have a Google tag snippet on your site and want to upgrade to using only Tag Manager, follow the steps in the migration guide.
Where is my Google tag ID in Google Tag Manager?
For subtitles in your language, turn on YouTube captions. Select the settings icon at the bottom of the video player, then select "Subtitles/CC" and choose your language.
- Go to Google Tag Manager.
- Sign in to your Google Account.
- Under Your Google tag, click the Google tag.
- Under Tag details, copy the Google tag ID.
Set up your Google tag in Google Tag Manager
Step 1: Create a Google tag
- Go to Google Tag Manager.
- Select the container you want to configure.
- In the Tags menu, click New.
- Enter a name for the tag
- In the Tag Configuration box, select Google tag.
- In the Tag ID field, enter your Google tag ID.
- Click Save.
Optional Settings
You can set up additional configuration options to govern how your Google tag communicates with destinations. If you set up the Google tag and want to keep all the default settings, you can skip to Step 2: Create a trigger.
- Global parameter settings: If you need to establish common context across several Google tags, you can specify global parameters using gtag.js directly on your website. Learn how to reuse parameters across multiple tags, in the developer documentation.
- Note: Global parameters are read by all Google tags on your website. Use this option only for non-sensitive data.
- Configuration settings: You can specify additional configuration parameters that influence the Google tag settings.
- To reuse configuration across Google tags, create a configuration settings variable.
- Shared event settings: You can specify additional parameters that are sent with every event, like the
currency
of a price. Event parameters are only valid for the tag you add them to.- To reuse event settings across Google tags, create a Google Tag Event Settings variable. Use recommended event parameter names so that Google Analytics can populate dimensions and metrics for you.
- Send data to a tagging server: Server-side tagging allows you to move some tags off of your website or app and onto a server instead, which allows you to improve performance. Learn more about Client-side tagging vs. server-side tagging.
- To send all events to a Tag Manager server container instead of Google Analytics, you need to configure the following parameter:
- Open the Configuration settings menu.
- Set up the server container URL by adding a new configuration parameter:
- Name:
server_container_url
- Value: Set to the server container URL of your Tag Manager server container
- Name:
- To send all events to a Tag Manager server container instead of Google Analytics, you need to configure the following parameter:
- Set up user properties: User properties are attributes that describe groups of your user base, such as their language preferences or geographic locations. You can use user properties to define audiences. For example, you can set a user property called
favorite_food
, which you can use to record each user's favorite food. You can use the data to segment users by their favorite food.- Analytics automatically collects some user dimensions so you don't have to define user properties for them. You can set up to 25 additional user properties per Google Analytics 4 property.
- To measure custom user properties you need to create a new Google Tag Event Settings variable and then assign it to the Google tag.
Step 2: Create a trigger
Set up a trigger to load the Google tag when someone loads your website.
- To ensure that the Google tag fires before other triggers, click Triggering and use the “Initialization - All pages” trigger. Learn more about Page triggers.
- Name the tag.
- Click Save.
Step 3: Publish the container
To update your website with the latest changes, click Submit.
Next steps
It may take up to 30 minutes for data collection to start. After data collection has started, verify your Google tag.
To set up more tags in Tag Manager, see your guide to Google Tag Manager.