Clicky

How to Add Analytics in AMP

Follow this steps to add Analytics in AMP

First go to WordPress Admin Area -> AMP option panel -> Settings -> Analytics.

In Analytics Type Option you can use Google Analytics or any other Analytics of your choice.

  • Google Analytics: When you enable  Google Analytics, you must enter your Google Tracking ID. Pasting Scripts are not allowed. Even if you use other Analytics, make sure you Enter tracking ID but not the Script. If you paste any script in analytics, it will lead you to errors.  Once disable Advanced Google Analytics and you save Tracking id option output will be checked into source code it will be shown below the footer area.
  • IP Anonymization: Allow website owners to request that all of their users’ IP addresses are anonymized within the product. This feature is designed to help site owners comply with their own privacy policies.
  • For example, if a website visitor has a public IP of 12.214.31.144 then as soon as the IP data is received by the Analytics Collection Network, Google will anonymize/mask the IP to 12.214.31.0.
  • It is important to remember that IP anonymization occurs before any data storage or processing takes place. So Google does not store or process complete IP addresses at any given time.
  • AMP Linker: AMP Linker is a new feature in AMP that helps keep user session in sync. It works by decorating outgoing links from AMP cache with params such as AMP Client ID in a URL parameter. On the receiving side, your analytics provider consumes the parameter and writes it down as a first-party cookie for more details Click Here.
  • Advanced Google Analytics: If you enable this option you can  Enter your Advanced Analytics code here inside this code you have to write account number for ex :(“account”: “UA-xxxxxxx-x”).

Enabling the IP Anonymization feature in Google Analytics for analytics.js

The IP Anonymization feature in Google Analytics is not enabled by default.

You would need to enable it by making a small code change or by adding a new variable in your GTM tag.

  • Google Tag Manager: When you enable to use of Google Tag Manager, then you have to enter the Tag Manager ID.

General Analytics Providers

The below-shown details are about some of the General Analytics Providers which are supported by our plugin – Facebook Pixel, Segment Analytics, Matomo (Piwik) Analytics, Quantcast Measurement, comScore, Effective Measure, StatCounter, Histats Analytics, Yandex Metrika, Chartbeat Analytics, Alexa Metrics, AFS Analytics, Adobe Analytics…

That’s it for this tutorial!

We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on February 14, 2020

    Are you still looking for a solution?

    Then fill out the below form and we will reach out to you within a few hours.

    Was this article helpful?

    Related Articles

    Comments

    1. I already have analytics installed. Do I need to do it again for AMP?

      1. Hi Steve,

        Where you install analytics?
        if you install in Non-AMP so need to install it again in AMP.

      1. Hi Bridie,

        IP Anonymisation allows website owners to request that all of their users’ IP addresses are anonymized within the product. This feature is designed to help site owners comply with their own privacy policies.

        For example, if a website visitor has a public IP of 12.214.31.144 then as soon as the IP data is received by the Analytics Collection Network, Google will anonymize/mask the IP to 12.214.31.0.

    2. I have enabled this just now and I can see hits but only for normal pages. I have also Woocommerce for AMP plugin but none of the product / category / tag pages is visible in GA?

    3. I have 2 google analytics account, how could i add them 2 in amp please? i need them it’s very important, i wish there is way to add them both,

      1. Hi motasem,

        If you want to add multiple Google Analytics in AMP then you need to add this code in AMP option panel -> Settings -> Analytics -> Enable Google Analytic option -> Enable Advanced Google Analytics like this screenshot -> https://take.ms/XLl4G and if you have issue/problem then contact our technical team – https://ampforwp.com/support/ they will help you as soon as possible.

    4. I have analytics installed and pageviews are not firing on my Google analytics. Why?

    5. Hello, these screenshots need to be updated for the new AMP

      google search console is giving me this warning “The script tag contains invalid JSON that cannot be parsed.”

      And, I have no idea what that means

    Leave a Comment