In this article, you will learn how to integrate Google Analytics into Magento 2 AMP Extension. Please follow the steps below to configure it correctly.
First, you need to log in to your Analytics account. You can use the same account for your AMP pages or create a new one. If you do not have a Google Analytics account yet, or you want to create a new one, please follow the official guide on how to create a Google Analytics account.
Next, make sure to set up a property in Google Analytics for the website you want to collect data for. Note that it is important to have a Universal Analytics property.
Please follow the quick guide below on how to get Tracking ID and set up Google Analytics for your Magento store.
Where to Get Google Analytics Tracking ID
In order to integrate Google Analytics into your AMP pages, you need to get your Tracking ID and paste it into Magento 2 AMP Extension backend. Please follow the steps below to find Google Analytics Tracking ID.
- Log in to your Google Analytics account and click Admin.
- Select an account from the menu in the Account column.
- Select a property from the menu in the Property column.
- Under Property, click Tracking Info > Tracking Code.
Afterward, you will be redirected to the Website Tracking page. Your Tracking ID code is displayed at the top of the page. Copy the Tracking ID code to paste it later in the configuration step.
How to Integrate Google Analytics With Magento 2 AMP Extension
In the main Magento menu, go to the Plumrocket -> AMP -> Configuration, and scroll down to Integrations -> Google Analytics.
- Enable: set to Yes to enable Google Analytics on your AMP pages.
- Tracking ID (Account Number): insert your Google Analytics Tracking ID code in this field.
- Click Save Config to apply settings.
Google Analytics integration with the Magento 2 AMP extension is now completed.