Before you install new tags, assess the tags that already exist on your website
or mobile app, if any, so you don't add any redundant tags. This document
describes ways to assess your existing tags.

Even after your preliminary assessment, you should incorporate regular checkups
as part of your standard tag-management process. Regularly evaluating the tags
that run on your website or app is important for data protection and security.

To assess your existing tags, use the following resources:

- [Google Tag Assistant](https://developers.google.com/tag-platform/devguides/existing#tag_assistant)
- Features within [Google Tag Manager](https://developers.google.com/tag-platform/devguides/existing#tag_manager)
- [Manual code inspection](https://developers.google.com/tag-platform/devguides/existing#manual_code_inspection) techniques

## Tag Assistant

[Google Tag Assistant](https://tagassistant.google.com) is a tag analysis tool for
installations of the Google tag. When enabled, Tag Assistant displays a debug
pane in the browser so you can inspect which gtag.js commands have fired and in
which order. Tag Assistant shows what data is being passed to [the data layer](https://developers.google.com/tag-platform/tag-manager/datalayer)
and what [events](https://developers.google.com/tag-platform/gtagjs/reference/events) triggered those data exchanges. It also displays the hits
(HTTP requests) and associated parameters.
[Learn more about Tag Assistant](https://support.google.com/tagassistant/answer/10039345).

## Tag Manager

You can inspect Tag Manager accounts and containers to analyze existing tag
configurations. Tag Manager also features a [preview mode](https://developers.google.com/tag-platform/devguides/existing#preview_mode), which
has similar functionality to [Tag Assistant](https://developers.google.com/tag-platform/devguides/existing#tag_assistant).

### Search

Use the search bar in the Tag Manager container to locate tags, settings, or
lines of code in your tags, triggers, and variables. The search bar is a great
way to pinpoint the tags that may contain settings or code that you need to
re-evaluate.

### Versions

The [Versions](https://support.google.com/tagmanager/answer/6107163) 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.

Tag Manager lists tags, triggers, variables, and custom templates in this view.

### Preview mode

Preview mode in Tag Manager shows 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](https://support.google.com/tagmanager/answer/6107056).

## Manual code inspection

To get a more thorough analysis of existing tag configurations, consider
performing 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()` commands](https://developers.google.com/tag-platform/devguides/existing#gtag), and these code fragments often contain additional instrumentation.
- `googletagmanager.com` -- This domain loads both Tag Manager and gtag.js 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, such as `utag.js` or `_satellite`.

### Google tag

If you've added the Google tag snippet to your web page, you can
review the tag to find more information about what it is being used for. The
current Google tag snippet looks like the following example:

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

Snippets from prior versions look like the following example:

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

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

In implementations using prior versions, you may see multiple
`gtag('config',...)` lines for additional products and accounts. For example:

      <!-- Google tag (gtag.js) - Prior version snippet -->
      <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', 'GA-XXXXXX-1');
    gtag('config', 'GA-YYYYYY-2');
    gtag('config', 'TAG_ID');
      </script>

> [!NOTE]
> **Note:** The `gtag('config')` command is deprecated. In updated Google tag installations, additional destinations and parameters are configured in the Google Tag Manager UI rather than adding multiple in-page `gtag('config')` lines. Existing `gtag('config')` calls will continue to work for backward compatibility. [Learn more](https://developers.google.com/tag-platform/gtagjs/reference#config).

Each `config` line in prior versions contains the product prefix (which
signals which product is being configured), followed by the ID for the account
being configured. See more information about the
[product prefixes](https://developers.google.com/tag-platform/devguides/existing#product-prefixes).

> [!NOTE]
> **Note:** The product and account whose ID is shown in the script source URL (i.e., the ID at the top of the snippet after `www.googletagmanager.com/gtm.js?id` or `/gtag/js?id`) is the one that "controls" the Google tag. In some cases it is important to know this, as some features such as [connected site
> tags](https://support.google.com/analytics/answer/9310895) for Google Analytics properties can only be activated from within a tag which is controlled by that product and account.

### Product prefixes for the Google tag

A tag or container ID identifies the Google Tag Manager container or Google destination configuration loaded by your Google tag snippet. New installations use a Google Tag Manager container ID (**GTM-** ) by default, while destination-specific IDs identify individual Google products. The following table provides an overview of supported ID prefixes:

| Prefix | ID type | Description |
|---|---|---|
| **GTM**-XXXXXX | Google Tag Manager container ID (default) | Default ID for Google Tag Manager containers. Supports all Google, third-party, and custom tags. |
| **G**-XXXXXX | Destination-specific ID | Identifies a Google Analytics destination (Measurement ID). |
| **AW**-XXXXXX | Destination-specific ID | Identifies a Google Ads destination (Conversion ID). |
| **DC**-XXXXXX | Destination-specific ID | Identifies a Floodlight destination (Advertiser ID). |
| **MC**-XXXXXX | Destination-specific ID | Identifies a Google Merchant Center destination. |
| **GT**-XXXXXX | Google tag ID | Identifies a Google tag created in prior versions. |

Web pages configured with the Google tag may use a `GTM-` container ID or a
destination-specific ID such as `G-` (Google Analytics), `AW-` (Google Ads),
`DC-` (Floodlight), or `MC-` (Merchant Center). If your page already loads a
Google tag with one of these IDs, you can connect additional destinations in
Google Tag Manager rather than adding another tag snippet to the page. [Learn
more about setting up tag IDs](https://support.google.com/tagmanager/answer/12002338)

> [!NOTE]
> **Note:** The prefix of the container ID you have on your site (such as `GTM-` versus `G-` or `AW-`) determines its script execution permissions and capabilities. For details, see [Container types and ID prefixes](https://developers.google.com/tag-platform/devguides/prerequisites#container_types_and_id_prefixes).

### 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-`". See the following example of the container ID placement:

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

Snippets from prior versions look like the following example:

    <!-- 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](https://tagmanager.google.com/#/home) and
click to search for this ID. You can
then inspect the \[tag, trigger, and variable configuration\][tag
configuration](https://support.google.com/tagmanager/answer/6103657) for your website.