The [Accelerated Mobile Pages](https://www.ampproject.org/) (AMP) project is an open-source web
platform that helps to improve the performance of your web content. AMP includes
built-in support for the Google tag and Google Tag Manager. This guide describes
how to set up Google Analytics for AMP pages.

## Installation

The Google tag lets you install Google Analytics, Google Ads, and other
Google products on AMP pages. Google Tag Manager sets up an AMP container and
gives you the ability to create advanced configurations and deploy third-party
tags from the Tag Manager interface.

> [!IMPORTANT]
> **Important:** Google Tag Manager for AMP doesn't support Google Analytics. If you want to use AMP with Google Analytics, you must [manually add](https://developers.google.com/tag-platform/gtagjs/amp?technology=gtagjs) the AMP snippet.

Select your platform preference from the following buttons:

<button value="tagmanager" default="">Tag Manager</button> <button value="gtagjs">Google tag</button>

## Troubleshooting

Use [validator.amp.dev](https://validator.amp.dev/) to validate your tagging setup or you can manually
ensure that the `cid` value is consistent across domains by doing the
following:

- Make sure to clear cookies or use Incognito mode.
- If `cid` is not found in a Google Analytics cookie, it can also be observed in your web browser's Network tab. Search for `collect request`, and the payload should contain a `cid` value.
- Once you have transitioned from the AMP page to another domain of
  your website, the
  `cid` and the `gclid` value should be passed using URL decoration:

      **_Linker format: mydomain.com?\_gl=1\*1ie2jr6\*\_ga\*WHFTa3JPckw2TGxZSzY5b3V1cVNVSmRIREI.\*gclid\*dGVzdA.._**

- The final landing page should still have the same `cid` value as in the
  initial landing page.

- Be careful with redirects and domain changes between the canonical page
  and non-AMP landing pages.