The Google tag powers the Google products you use with the data to measure the effectiveness of your website and ads. The Google tag sends data to connected destinations, such as Google Ads and Google Analytics 4.
As website technologies such as cookies continue to evolve due to privacy, browser, and regulatory changes, having high-quality, site-wide tagging is important to help ensure youâre getting the most accurate measurement.
This article shows you:
- Where to find your existing Google tag
- How to install the Google tag on your website
- How to verify if your setup is working
Where is my Google tag ID?
Where is my Google tag ID?
You can find your Google tag settings within Google Ads, Google Analytics, and Google Tag Manager. Log in to a product and follow the instructions to view your tag ID:
You can find your Google tag ID in several Google products: Google Ads, Google Analytics, Campaign Manager 360, and Google Tag Manager. To view your tag ID, simply log in to the relevant product and then follow the specific instructions provided for that platform.
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.
In Google Ads
- Open the Google tag settings in Google Ads.
- Sign in to your Google Account. Learn how to create a Google Account.
- Navigate to Tools and then Data Manager.
- Under Google tag, find the Google tag and then click Manage.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Google Analytics
- Go to https://analytics.google.com/analytics/web/.
- Sign in to your Google Account. Learn how to create a Google Account.
- In Admin, under Data collection and modification, select Data Streams.
Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to open your Google tag settings.
- Select the data stream that you want to edit.
- Under Google tag, click Configure tag settings
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Campaign Manager 360
- Go to https://campaignmanager.google.com.
- Sign in to your Google Account. Learn how to create a Google Account.
- Under Floodlight, click Google Tag to edit the Google tag settings.
- Under Google tag, click Configure tag settings.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Google Tag Manager
- Go to https://tagmanager.google.com.
- Sign in to your Google Account. Learn how to create a Google Account.
- In the Google tags tab, select the Google tag.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
What is a destination and a destination ID?
What is a destination?
A destination is a Google measurement product account that shares configuration with, and receives data from, a Google tag. You can add destinations to your Google tag to reuse your Google tagâs configuration and footprint on your site.
Currently, there are 4 destination types:
- Google Analytics 4 web data stream
- Google Ads account
- Floodlight configuration (used in Campaign Manager 360, Display & Video 360)
- Merchant Center conversion source
What is a destination ID?
A destination ID is an identifier that represents the destination; i.e., the connected Google product, such as Google Ads or Google Analytics. The Google tag uses destination IDs to load destination-specific settings and to route events.
For Google Ads, the destination ID is the same as the conversion tracking ID, for example AW-98765.
For Google Analytics, the destination ID is the same as your web data stream's Measurement ID, for example G-12345.
Install the Google tag on your website
To start measuring website and ads performance, you need to add the Google tag on every page of your website.
Pick a product you use to set up the Google tag.
If you have more complex measuring needs and want to manage third party tags as well, use Google Tag Manager to set up your Google tag.
Set up your Google tag in Google Ads instructions
- Use the Google tag found on your website (Recommended)
- Use a Google tag you already have
- Install a Google tag
Use the Google tag found on your website (Recommended)
Use the tag detected on your website to complete setup without making changes to your siteâs code. Users for your account will be added as users on the tag. Learn more about managing your Google tag.
- Click Details to view your tag details.
- Click Finish.
Note: As a best practice, donât add more than one instance of your Google tag to each page of your website.
- When youâve set up your tag, you need to configure your Google tag settings.
- You can launch Tag Assistant to test your key event action and data collection.
Use a Google tag you already have
This option shows whether the tag was detected on the site you entered. Choose a tag labeled "On site" to complete setup without making changes to your site's code.
Note that if your site has low traffic volume, your tag may be shown as "Not detected". If you choose a tag labeled "Not detected", you may need to install it. Users for your account will be added as users on the tag. Learn more about managing your Google tag
If you have admin access to the tags listed, youâll find them. If you can't find the tag you're looking for, you may not have the appropriate user permissions to make changes to that Google tag.
- Click Choose a tag to discover:
- The list of tags you have admin access to
- Tag IDs
- Where the tag was detected
- If the tag is detected on the site you entered, you can choose a tag labeled âOn siteâ to complete setup without making changes to your siteâs code. If you choose a tag labeled âNot detectedâ, you may need to install it.
- Select the Google tag you want to use, then click Confirm.
Install a Google tag
You can install the Google tag 2 ways:
- Using a website builder.
- Manually
Using a website builder
You can use a website builder or content management system (CMS) such as Wix or Duda to deploy your Google tag. Select your website builder and follow the instructions to finish setting up your Google tag without making changes to your code. If you're trying to deploy a tag via a CMS or Website builder integration, but the CMS integration doesnât accept a GT- tag ID, you can use an alias (AW-XXXXX or G-XXXXX) that's supported by the CMS integration.
You can finish setting up your Google tag without making changes to your code if you manage your site using one of these platforms:
Learn more about installing your Google tag with a website builder.
When youâre finished with your installation:
- Click Done, and Google will scan your website.
- Click Done to finish your Google tag setup.
Install manually
Choose this option if itâs your first time setting up the tag for a conversion action in your account and you havenât installed the Google tag.
- To install the tag, copy and paste it into the code of every page on your website immediately after the
<head>
element. Donât add more than one Google tag to each page. Hereâs an example of a Google tag, where âTAG_IDâ stands for the tag ID thatâs unique to your Google Ads account:
<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> - (Optional) Modify the Google tag based on your preferences:
- If you donât want the Google tag to add website visitors to your remarketing lists on initial page load, add the highlighted portion below to your Google tagâs 'config' command:
gtag('config',' TAG_ID',{'send_page_view': false});
- If you donât want the Google tag to set first-party cookies on your siteâs domain, add the highlighted portion below to your Google tagâs 'config' command:
gtag('config',' TAG_ID',{'conversion_linker': false});
- Note: We donât recommend doing this as it will lead to less accurate conversion measurement. If you want to disable the collection of remarketing data, add the highlighted
gtag('set')
command to your Google tag above thegtag('js')
command. This will disable the collection of remarketing data for all configured Google Ads accounts.
<script async
src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('set', 'allow_ad_personalization_signals', false);
gtag('js', new Date());
gtag('config', 'TAG_ID');
</script>
- Note: We donât recommend doing this as it will lead to less accurate conversion measurement. If you want to disable the collection of remarketing data, add the highlighted
- If you donât want the Google tag to add website visitors to your remarketing lists on initial page load, add the highlighted portion below to your Google tagâs 'config' command:
- Copy the Google tag, then add it to your website.
- Open the HTML for the page your customers reach on your website after they've completed a conversion; for example, the "Thank you for your order" page. This is called the conversion page.
- Between the head tags (
<head></head>
) of the page, paste your global site tag, then, any event snippets that apply to the page. - Save the changes to your webpage.
- Click Done.
- Click Install event tag.
- Next to "Event snippet," select whether to track conversions on a page load or click.
- Page load: Count conversions when customers visit the conversion page, such as a confirmation page for a purchase or sign-up. This is the default and most common option. Learn more about Google's security standards.
- Click: Count conversions when customers click a button or link (such as a "Buy Now" button).
- Copy the event snippet, then follow the instructions to add it to your website, or click Download snippet to add it later.
- If you're tracking conversions by page load, add the event snippet to the page you're tracking.
- If youâre tracking conversions by click, add the event snippet to the page that has the button or link youâd like to track for clicks.
- Click Next.
- Click Done.
- Click Finish. If youâre tracking clicks on your website as conversions, follow the instructions in Track clicks on your website as conversions to add an additional piece of code to the button or link youâd like to track. This step is required for conversion tracking to work.
When youâve set up your tag, you need to verify that your Google tag works.
Set up your Google tag in Google Analytics instructions
- In Admin, under Data collection and modification, select Data Streams.
Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to set up your Google tag.
- Click the data stream that you want to edit.
- Under âGoogle tagâ, click Configure tag settings.
- In the âYour Google tagâ section, click Installation instructions.
- In the âInstallation instructionsâ page, select either âInstall with a website builderâ or âInstall manuallyâ:
- Use âInstall with a website builder" if you manage your site using a website builder (or âCMS platformâ, like Wix or Wordpress). Select your website builder and follow the instructions to finish setting up your Google tag without making changes to your code.
- If you choose to install manually, go to the âInstall manuallyâ section. On the screen, youâll notice the JavaScript snippet for your account's Google tag. To establish a connection between your website and Google Analytics, copy and paste your entire Google tag snippet in the code of every page of your website, immediately after the
<head>
element. Your Google tag is the entire section of code that appears, beginning with:
<!-- Global tag (gtag.js) -->
and ending with
</script>
It may take up to 30 minutes for data collection to start. You can then use the Realtime report to verify that you're receiving data.
When youâve set up your tag, verify that your Google tag works.
To add and configure a Google Analytics 4 property to a site that already has a GA4 property set up, you can use the GA4 Setup Assistant.
Set up your Google tag in Campaign Manager 360 instructions
You can install the Google tag in one of the following ways:
- Manually
- Using a website builder.
Install manually
If you have a custom built website, use this option to add the Google tag manually in your website.
- In the âGoogle tagâ tab, click Installation instructions.
- Under the âInstall manuallyâ tab, copy the Google tag code.
Example Google tag
Hereâs an example of a Google tag, where âTAG_IDâ stands for the tag ID thatâs unique to your Google Ads account:
<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> -
Paste it into the code of every page on your website immediately after the
<head>
element.
Using a website builder
You can use a website builder or content management system (CMS) such as Wix or Duda to deploy your Google tag. Select your website builder and follow the instructions to finish setting up your Google tag without making changes to your code.
Learn more about installing your Google tag with a website builder.
When youâre finished with your installation:
- Click Done, and Google will scan your website.
- Click Done to finish your Google tag setup.
Note: As a best practice, donât add more than one instance of your Google tag to each page of your website.
When youâve set up your tag, verify that your Google tag works.
Set up your Google tag in Google Tag Manager instructions
You can deploy your Google tag with Google Tag Manager to manage it along with all your other tags.
Before you begin
To set up a Google tag in Tag Manager you need a Google tag ID. If you arenât sure where to find your tag, see Where is my Google tag ID?
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.
Step 1: Create a Google tag
Start by creating a Google tag to set up your measurement.
- Open Google Tag Manager
- Select the container you want to configure. Open the Tags menu.
- Create a New tag. Enter a name for the tag at the top (e.g., "Google tag configuration - example.com").
- In the Tag Configuration box, select Google tag.
- Configure your tag. In the field Tag ID, enter your Google tag ID.
Where is my Google tag ID?
You can find your Google tag settings within Google Ads, Google Analytics, and Google Tag Manager. Log in to a product and follow the instructions to view your tag ID:
You can find your Google tag ID in several Google products: Google Ads, Google Analytics, Campaign Manager 360, and Google Tag Manager. To view your tag ID, simply log in to the relevant product and then follow the specific instructions provided for that platform.
How to find your Google tag ID and use it for website trackingFor 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.
In Google Ads
- Open the Google tag settings in Google Ads.
- Sign in to your Google Account. Learn how to create a Google Account.
- Navigate to Tools and then Data Manager.
- Under Google tag, find the Google tag and then click Manage.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Google Analytics
- Go to https://analytics.google.com/analytics/web/.
- Sign in to your Google Account. Learn how to create a Google Account.
- In Admin, under Data collection and modification, select Data Streams.
Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to open your Google tag settings.
- Select the data stream that you want to edit.
- Under Google tag, click Configure tag settings
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Campaign Manager 360
- Go to https://campaignmanager.google.com.
- Sign in to your Google Account. Learn how to create a Google Account.
- Under Floodlight, click Google Tag to edit the Google tag settings.
- Under Google tag, click Configure tag settings.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
In Google Tag Manager
- Go to https://tagmanager.google.com.
- Sign in to your Google Account. Learn how to create a Google Account.
- In the Google tags tab, select the Google tag.
- Under Your Google tag, click the Google tag (left side of the diagram).
- Under Tag details, copy the Google tag ID.
- Optional: You can set up additional configuration options to govern how your Google tag communicates with its destinations. If you set up the Google tag and want to keep all its default settings, you can now skip to Step 2: Create a trigger.
Optional settings
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.
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, for example 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 an 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 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:
Result: Your configuration parameters should look like this:
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.
7. Save your Google tag.
Step 2: Create a trigger
Next, 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 and Save the tag configuration.
Result
Your tag configuration should look like this:
Step 3: Publish the container
To update your website with the latest changes, click the Submit button at the top right.
Result
When youâve set up your tag, verify that your Google tag works.
To set up more tags in Tag Manager, see your guide to Google Tag Manager.
Verify your tag sends data
- Open Google Tag Assistant
- Enter your siteâs URL.
- Tag Assistant shows you all detected tags at the top. Check if your Google tag is showing up.
- In the Summary tab, check if the tag sent any events.
- â Your Google tag is set up correctly when it records and dispatches events.
- â If you donât see your Google tag or it doesnât collect requests, see the sections below for more guidance.
Remember to set up the Google tag on every website that should send data. To check where your Google tag has been found, access the tag coverage summary.
No tag found
If Tag Assistant didnât find your Google tag, make sure that:
- Youâre adding the correct measurement ID
- Your code is live. You can use your browserâs developer tools to see what code has been loaded.
Destination doesnât receive data
If Tag Assistant is showing that your Google tag is on your page, but you still donât see any data, your Google tag might not be connected to a destination.
In that case, you will be notified when you open the Google tag page. You can choose to connect the destination to an existing Google tag or to create a new Google tag.
Next steps
Once you've set up your Google tag, make sure you configure it to send the data you need.
Configure your Google tag settings â