Thanks for previewing Google's new tag documentation! This site is in public beta. (Feedback)

Analyze existing tag configurations

Before you install any new tags, it is important to understand what tags already exist on your website or mobile app, if any. You should assess existing tag configurations so that you don't add any extra or redundant tags to your installation. If you are unsure what the current state of tag installations are on your web pages, this article will describe ways to analyze your existing tag configurations.

To analyze tags, you can leverage Google Tag Assistant, features within Google Tag Manager, or you can use manual code inspection techniques.

Tag Assistant

Google Tag Assistant is a tag analysis tool for global site tag (gtag.js) installations. When enabled, Tag Assistant will display a debug pane in the browser below the website content so that you can inspect which global site tag commands have fired and in which order. Tag Assistant shows what data is being passed to the data layer, and what events triggered those data exchanges. It will also display the hits (http requests) and associated parameters. Learn more about Tag Assistant.

Tag Manager

You can inspect Tag Manager accounts and containers to analyze existing tag configurations. Tag Manager also features a preview mode which has similar functionality with Tag Assistant.

Versions

The Versions feature in Tag Manager shows a summary of an existing container configuration.

  1. In Tag Manager, click Versions.
  2. Click the most recent version in the list to see the current state of the container. Tags, triggers, variables, and custom templates will be listed in this view.

Preview mode

Tag Manager's preview mode can show what tags are firing on a page, what events trigger those tags, and what data is being pushed to the data layer. Preview mode functions in much the same way as Tag Assistant. Learn more about preview mode.

Manual code inspection

To get a more thorough analysis of existing tag configurations, it is sometimes necessary to perform a manual code inspection. Search your source code for some of these common tag keywords to help identify any potential tag configurations:

  • gtag( – This is the opening for gtag() functions, and these code fragments often contain additional instrumentation.
  • googletagmanager.com – This domain is used to load both Tag Manager and global site tag functionality, and can help you locate those types of tags.

If you already have either gtag.js or Google Tag Manager, you may be able to update existing tags or instrumentation instead of implementing new configurations.

  • dataLayer – Can be used to find out if data layer code has been established, and dataLayer.push() calls with instrumentation for specific events.
  • analytics.js or ga.js – File names of the libraries used for legacy Google Analytics implementations.
  • conversion.js or conversion_async.js - File names of the libraries used for Google Ads conversion measurement.
  • optimize.js – Used for Google Optimize tags.
  • Third-party tag management systems that might contain Google tags. Look in your source code for potential third-party tag management systems, e.g. utag.js or _satellite.

Global site tag (gtag.js)

If you have a global site tag present on your page, you can review the tag to find more information about what it is being used for. The core tag will look something like this example:

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXX-1"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'UA-XXXXXX-1');
  </script>

You may see multiple gtag('config',...) lines for for additional products and accounts. For example:

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXX-1"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    
    gtag('config', 'UA-XXXXXX-1');
    gtag('config', 'UA-YYYYYY-2');
    gtag('config', 'AW-XXXXXX');
    gtag('config', 'G-XXXXXX');
  </script>

Each config line contains the product prefix (which signals which product is being configured), followed by the ID for the account being configured. You can see more information about the product prefixes below.

Product prefixes for global site tags

UA Your global site tag is controlled by Google Analytics. The ID is your Google Analytics Measurement ID. To find the property associated with this ID, use the account search feature in Google Analytics. If the property does not appear, you probably do not have access to it.
G Your global site tag is controlled by a Google Analytics 4 stream. The ID is your Google Analytics Measurement ID.
AW Your global site tag is controlled by Google Ads. The numeric string following the AW prefix is your Google Ads Conversion ID.
DC Your global site tag is controlled by a Floodlight tag. The numeric string following DC is your Advertiser ID.
other Your global site tag is controlled by a different Google product or may be implemented incorrectly. Use Tag Assistant to verify.

Google Tag Manager

Web pages configured with Tag Manager will have a container tag installed that looks similar to the following example. You can identify the Tag Manager container ID by inspecting the container code. The container ID begins with "GTM-", and an example of the container ID placement is highlighted below.

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<:!-- End Google Tag Manager -->

Once you have the container ID, open the Google Tag Manager accounts screen and click to search for this ID. You can then inspect the tag, trigger, and variable configuration for your website.