The Google tag lets you send data from your website to connected Google product destinations to help you measure the effectiveness of your website and ads. The Google tag is currently only accessible and configurable from Google Ads and Google Analytics 4.
Google Tag Manager doesn’t support all Google tag functionality yet. Learn more
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.
To start collecting data, you need to put the Google tag in the code of your website. The Google tag must be on every page that has data you want to collect.
When you've set up your Google tag you can:
- Configure your Google tag settings
- Manage your Google tag (optional)
- Manage your Google tag users (optional)
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.
What is a destination?
A destination is a Google measurement product account that's connected to, shares configuration with, and receives data from a given tag. A destination ID is an identifier that represents the destination (for example, the connected Google product). These IDs are primarily used by the tag to load destination-specific settings and to route events.
Currently, only the following can be destinations:
- Google Ads accounts
- Web data streams in Google Analytics 4 properties
How to find your tag IDs
You can find all of your tag IDs in the “Your Google tag“ section of the “Configuration“ tab.
Tag ID: A tag ID is an identifier that you put on your page to load a given tag. Your tag ID is displayed under the Google tag on the left side of the Google tag “Configuration“ tab. By default, only a single tag ID is displayed when there is only one destination.
A single tag can have multiple tag IDs. You’ll notice a “main” ID displayed. Sometimes multiple tag IDs are displayed after combining tags. If you remove a destination, it doesn’t change existing tag IDs.
Destination ID: A destination ID is an identifier that represents the connected Google product. These IDs determine which Google product accounts receive events sent by this tag.
For Google Ads, the destination ID is usually the same as the conversion tracking ID. For Google Analytics, the destination ID is usually the same as your web data stream's Measurement ID.
To view the destination ID, click the destination name. The “Destinations“ section of the “Manage Google tag“ tab lists all of your destinations, their IDs, and the date they were added. A maximum of 10 destinations can be linked to a Tag ID.
Set up your Google tag from 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 conversion 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 configure your Google tag settings.
You can launch Tag Assistant to test your conversion action/data collection.
Set up your Google tag from Google Analytics instructions
How you set up your Google tag from Google Analytics depends on if you're setting up Analytics for the first time on your site or if you're adding a Google Analytics 4 property to a site that already has Universal Analytics.
If you're setting up Google Analytics for the first time
- Sign in to your Google Analytics account.
- Click Admin.
- At the top of the “Property“ column, use the dropdown selector to select the property that contains the data stream for which you want to set up your Google tag.
- In the “Property“ column, click Data streams.
- 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, you need to configure your Google tag settings.
You can launch Tag Assistant to test your conversion action/data collection.
If you're adding a Google Analytics 4 property to a site that already has Universal Analytics
To add a Google Analytics 4 property to a site that already has Universal Analytics, you can use the GA4 Setup Assistant. You need the Editor role for the Analytics account. Follow the instructions below to create your GA4 property. You can use this wizard regardless of if your website pages have a Google Analytics tag (gtag.js or analytics.js), a Google Ads tag (gtag.js), or a Google Tag Manager container.
- In Google Analytics, click
Admin (lower left).
- In the Account column, make sure that your desired account is selected. (If you only have one Google Analytics account, it's already selected.)
- In the Property column, select the Universal Analytics property that currently collects data for your website.
- In the Property column, click GA4 Setup Assistant. It's the first option in the Property column.
- Click Get started under I want to create a new Google Analytics 4 property.
- In the Create a new Google Analytics 4 property pop-up screen, you'll have one of the following options, depending on how your site is currently tagged:
- Create and continue. Click this button to continue to the Set up a Google tag page (step 7).
- Create property. If you see this option, this means that Analytics can reuse your existing Universal Analytics tagging for your GA4 property. Analytics will create a connected site tag between your Universal Analytics and GA4 properties. Select this option and skip to the Next steps with your new GA4 property section (below).
Note for advanced users: This option implements standard data collection for your GA4 property. If you've implemented any custom tags for your UA property, review these considerations for additional steps.
- On the Set up a Google tag page, select the option that best describes your situation and follow the instructions to finish creating your new GA4 property:
Use the Google tag found on your website (Recommended)
Select this option to use the Google tag detected on your website to complete setup without making changes to your site's code.
If desired, click Details to view your tag details.
Click Confirm to finish creating your new GA4 property.
Users on your property will be added as users on the Google tag. Learn more about managing your Google tag.
Use a Google tag you already have
Select this option to reuse a Google tag that you already have admin access to.
Click Choose a tag. You'll see:
- A list of tags you have admin access to. (If you don't see the tag you are looking for, you might not have the appropriate user permissions to make changes to that Google tag.)
- Tag IDs
- Whether or not the tag was detected on your website. 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 might need to install it. (Note that if your site has low traffic volume, your tag may be shown as "Not detected".)
- The destinations that are associated with the tag
Select the Google tag you want to use, then click Confirm to finish creating your new GA4 property.
Users on your property will be added as users on the tag. Learn more about managing your Google tag
Install a Google tag
Select this option if you don't have the Google tag installed on your website.
- Click Next to install a new Google tag on your website.
- On the Installation instructions page, you have 2 options:
- Install with a website builder: If you manage your site using certain website builders (or "CMS platforms," like Wix or Duda), you can finish setting up your Google tag without making changes to your code.
- Install manually: Choose this option if one of the following is true:
- Your website builder/CMS does not yet support the Google tag (gtag.js)
- You or your web developer are manually tagging your website
- Your website is tagged with analytics.js
- You use Google Tag Manager
Option 1: Install with a website builder or CMS
If you manage your site using one of the following platforms, select your platform and follow the instructions to finish setting up your Google tag without making changes to your code.
When you've finished installing your Google tag, click Done to finish creating your new GA4 property.
If your platform doesn't yet support the Google tag, you can use the manual installation option (below).
We're continually updating our CMS instructions to make it as easy as possible for you to set up your Google tag. If you don't see your platform on the Installation instructions page, you might still be able to paste your Google tag ID into your website builder or CMS. Before installing manually, check for your platform on this listLearn more about installing your Google tag with a website builder.
Option 2: Install manually
Choose this option if one of the following is true:
- Your website builder/CMS does not yet support the Google tag (gtag.js). Note: You'll need to use your platform's custom HTML feature
- You or your web developer are manually tagging your website
- Your website is tagged with analytics.js
- You use Google Tag Manager
How to manually install the Google tag
On the Install manually tab, you'll see the JavaScript snippet for your Google tag. To establish a connection between your website and Google Analytics, copy and paste your entire Google tag in the code of every page of your website, immediately after the
<head>
element. Don’t add more than one Google tag to each page.If you're using a website builder/CMS that doesn't yet support the Google tag, copy and paste your entire Google tag using your platform's custom HTML field.
Your Google tag is the entire section of code that appears, beginning with:
<!-- Google tag (gtag.js) -->
and ending with
</script>
When you've finished installing your Google tag on your website, click Done to finish creating your new GA4 property.When you've set up your tag, you need to configure your Google tag settings
If your website is tagged with analytics.js, either manually or with a CMSIf your website is manually tagged with analytics.js, don't remove the old analytics.js tag when you add the Google tag (above). The analytics.js tag will continue to collect data for your Universal Analytics property. The Google tag (gtag.js) that you're adding will collect data for your new GA4 property.
If you're using a website builder/CMS that tags your pages with analytics.js, you can use the custom HTML feature to add the Google tag to your pages. Leave the analytics.js tag in place so that Analytics still sends data to your Universal Analytics property.
The following table lists website builders and CMSs that use analytics.js and require that you add your Google tag as custom HTML in order to have both tags on your site.
Copy and paste your Google tag to your website using your CMS's custom HTML feature.
Use the Realtime report to verify that you're receiving data.
Website builder / CMS Options to add custom HTML Blogger Instructions Cart.com Contact Cart.com support for instructions Salesforce (Demandware) Contact Salesforce support for instructions VTEX Contact VTEX support for instructions Weebly Instructions If you add your tag using Google Tag ManagerFor basic data collection, follow the Google Tag Manager help center instructions to add the Google Analytics: GA4 Configuration tag using your Google Tag Manager account.
After you're finished, make sure to click Done in the GA4 Setup Assistant to finish creating your connected GA4 property.
No tag found
It's possible for a destination to get in a state where it isn't attached to a Google tag. For that destination to receive data, it must be connected to a Google tag.
If your destination isn't connected to a tag, you'll 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.