Tag setup for AMP

The Accelerated Mobile Pages (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.

Select your platform preference from the following buttons:

Troubleshooting

Use amptagtest.appspot.com 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 passed from the Google CDN to the client website, the cid and the gclid value should be passed via 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.