Set up your Google tag

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:

A concept illustration demonstrating how to set up your Google tag.

Note: All global site tags have been converted into Google tags. If you have a global site tag on your website, you don’t need to update your site to use the Google tag.

How to use the Google Tag video tutorial

This video shows you how to set up your Google tag as a Google Ads user. You can also set up the Google tag via Google Analytics 4, Campaign Manager 360, and Google Tag Manager.

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.


What is a tag ID and where to find it?

What is a Google tag ID?

Tag ID: A tag ID is an identifier that you put on your page to load a given tag. A single tag can have multiple tag IDs. You'll notice a "main" ID displayed.

If you combine or split your tags, the main tag ID displayed in the tagging instructions snippet can change. You don’t need to retag your page if this happens. As long as you have one of the tag IDs on the page, it will load the same tag. If you remove a destination, it doesn’t change existing tag IDs.

Note: If your CMS integration (also known as a “website builder“) doesn't accept a GT- tag ID, you can use an alias, such as AW-XXXXX or G-XXXXX that's supported by the CMS integration.

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:

Google Ads instructions

Google Analytics instructions

  1. Open Google Analytics.
  2. Go to the Admin screen.
  3. In Data Streams, click on a stream to see details.
    Result: Your screen should show you the Google Analytics settings and the Google tag settings.Screenshot of the Google Analytics 4 data stream settings. The Google tag settings are located in the data stream settings

Campaign Manager 360 instructions

  1. Open Campaign Manager 360.
  2. Under “Floodlight”, click Google Tag to edit the Google tag settings.

Google Tag Manager instructions

Note: To see Google tag IDs in Google Tag Manager, you need to manage a Google Ads, Analytics or Google tag in a container.

  1. Open Google Tag Manager.
  2. Click on the tab Google tags to see Google tags you have previously set up.
    Google tag overview in Google Tag Manager
  3. Click on the tag name to edit the Google tag settings.

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, only Google Ads accounts and web data streams in Google Analytics 4 properties can be destinations.

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.

Tip: If you use both Google Ads and Google Analytics, set up the Google tag in only one platform. You can add the other product later on as a destination in your Google tag settings.


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 the Google tag from Google Ads instructions

Before you set up the Google tag, make sure you’ve set up conversion tracking for your website. On the "Set up a Google tag" page, select the option that best describes your situation and follow the instructions to install the tag:
  1. Use the Google tag found on your website (Recommended)
  2. Use a Google tag you already have
  3. 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.

  1. Click Details to view your tag details.
  2. Click Finish.

Note: As a best practice, don’t add more than one instance of your Google tag to each page of your website.

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.

  1. Click Choose a tag to discover:
    1. The list of tags you have admin access to
    2. Tag IDs
    3. 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.
  2. 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

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:

  1. Click Done, and Google will scan your website.
  2. 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.

  1. 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. An animation that demonstrates how to install the Google site tag for conversion tracking in Google Ads. 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>
  2. (Optional) Modify the Google tag based on your preferences:
    1. 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});
    2. 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 the gtag('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>
  3. Copy the Google tag, then add it to your website.
  4. 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.
  5. Between the head tags (<head></head>) of the page, paste your global site tag, then, any event snippets that apply to the page.
  6. Save the changes to your webpage.
  7. Click Done.
  8. Click Install event tag.
  9. 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). An animated gif that depicts how to  edit event snippet preferences.
  10. 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.
  11. Click Next.
  12. Click Done. An animated gif that shows the option to copy or download an event snippet within the Google Ads UI.
  13. 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.
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 verify that your Google tag works.

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

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. 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.
  4. In the “Property“ column, click Data streams.
  5. Click the data stream that you want to edit.
  6. Under “Google tag“, click Configure tag settings.
  1. In the “Your Google tag” section, click Installation instructions.
  2. 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>
Note: As a best practice, don’t add more than one instance of your Google tag to each page of your website.

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.

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.

  1. In Google Analytics, click Settings Admin (lower left).
  2. In the Account column, make sure that your desired account is selected. (If you only have one Google Analytics account, it's already selected.)
  3. In the Property column, select the Universal Analytics property that currently collects data for your website.
  4. In the Property column, click GA4 Setup Assistant. It's the first option in the Property column.
  5. Click Get started under I want to create a new Google Analytics 4 property.
  6. 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:
  7. 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.

    1. Click Next to install a new Google tag on your website.
    2. 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 list

    Learn 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

    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 CMS

    If 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
     

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.

  1. In the “Google tag” tab, click Installation instructions.
  2. Under the “Install manually” tab, copy the Google tag code. An animation that demonstrates how to install the Google site tag for conversion tracking in Google Ads.

    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>
  3. 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:

  1. Click Done, and Google will scan your website.
  2. 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.

  1. Open Google Tag Manager
  2. Select the container you want to configure. Open the Tags menu.
  3. Create a New tag. Enter a name for the tag at the top (e.g., "Google tag configuration - example.com").
  4. In the Tag Configuration box, select Google tag.
  5. 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:

    Google Ads instructions

    Google Analytics instructions

    1. Open Google Analytics.
    2. Go to the Admin screen.
    3. In Data Streams, click on a stream to see details.
      Result: Your screen should show you the Google Analytics settings and the Google tag settings.Screenshot of the Google Analytics 4 data stream settings. The Google tag settings are located in the data stream settings

    Campaign Manager 360 instructions

    1. Open Campaign Manager 360.
    2. Under “Floodlight”, click Google Tag to edit the Google tag settings.

    Google Tag Manager instructions

    Note: To see Google tag IDs in Google Tag Manager, you need to manage a Google Ads, Analytics or Google tag in a container.

    1. Open Google Tag Manager.
    2. Click on the tab Google tags to see Google tags you have previously set up.
      Google tag overview in Google Tag Manager
    3. Click on the tag name to edit the Google tag settings.
  6. 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.

Global parameters are read by all Google tags on your website. Use this option only for non-sensitive data.

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:

  1. Open the Configuration settings menu.
  2. 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

Result: Your configuration parameters should look like this:Screenshot of a server-side tagging implementation in the Google tag.

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.

  1. To ensure that the Google tag fires before other triggers, click Triggering and use the Initialization - All pages trigger. Learn more about Page triggers.
  2. Name the tag and Save the tag configuration.

Result

Your tag configuration should look like this:

Screenshot of the finished Google tag setup

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

  1. Open Google Tag Assistant
  2. Enter your site’s URL.
  3. Tag Assistant shows you all detected tags at the top. Check if your Google tag is showing up.
  4. 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 →

Related links

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu