In this article, you will learn how to integrate Google Tag Manager into Magento 2 AMP extension. Google Tag Manager allows you to easily configure and deploy tags on your AMP pages, including tags from Google Ads, Google Analytics, Floodlight, and 3rd parties. Please follow the steps below to integrate Google Tag Manager correctly.
How to Create AMP Container in Google Tag Manager
- Create an account at tagmanager.google.com or use an existing Google Tag Manager account.
- Follow the official guide and create an AMP container in Google Tag Manager.
- After you create your new AMP container, the Install Google Tag Manager screen will appear. There, Google Tag Manager provides you with two code snippets.
- Copy and paste the code to the Snippet field of the Magento 2 AMP Extension configurations in Magento admin panel.
- Do not perform any action on this code, as it will be automatically added to your Magento 2 AMP pages.
To access the code snippets later, click the container ID number at the top of your workspace overview page, or click Admin and then Install Google Tag Manager.
You may also use the official guide to configure tags in your Tag Manager container and publish it for the changes to take effect.
How to Integrate Google Tag Manager With Magento 2 AMP Extension
In the main Magento menu, go to the Plumrocket -> AMP -> Configuration, and scroll down to Integrations -> Google Tag Manager.
- Enable: set to Yes to enable Google Tag Manager on your AMP pages.
- Snippet: paste the code from your Google Tag Manager account. You can access the code snippet by clicking the container ID number at the top of your workspace overview page, or click Admin and then Install Google Tag Manager.
Google Tag Manager integration with the Magento 2 AMP extension is now completed.
AMP Integrations Supported by Google Tag Manager
- Adobe Analytics
- AT Internet
- Custom image
- Google Ads
- Google Analytics
- Salesforce DMP (Krux)
- Nativo (formerly SimpleReach)