Set up tracking for AMP pages

To set up tracking for AMP pages (Accelerated Mobile Pages), take the following steps in Google Tag Manager.

1. Create a new GTM container for AMP pages. To do that, go to the Admin tab, click at the container column. In the container creation menu, select AMP:AMP_pages_0.png

2. In the Tags menu, create tags that will be sent to Google Analytics along with the data. Here, include the custom dimension  "Page Client ID" and the trigger that fits your case. For example:AMP_pages_1.png

3. In the Variables menu, in the Built-In Variables block, click Configure and check all 13 variables shown in the screenshot: AMP_pages_2.png

4. Back in the Tags menu, create one more tag with the Custom Image type. As a trigger, use the same you used for the tag that is being sent to Google Analytics. In the Image URL field, paste this URL:

https://google-analytics.bi.owox.com/UA-XXXXXXX-X?v=1&ds=AMP&dt={{Document Title}}&sr={{Screen Height}}x{{Screen Width}}&cid={{Page Client ID}}&tid=UA-XXXXXXX-X&dl={{Page URL}}&dr={{Document Referrer}}&ul={{Browser Language}}&t=pageview

Note: The URL contains a Google Analytics Tracking ID (UA-XXXXXXX-X) in two places. When copying this URL to Google Tag Manager, make sure you've changed the "UA-XXXXXXX-X" placeholder to your Tracking ID in both places.

AMP_Tracking_Custom_Image_URL_en.png

5. Publish the container.

Done. With these settings, data will be sent to both Google Analytics and Google BigQuery every time the trigger fires. You can also add additional parameters to the URL if needed.

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.