How To Add Google Analytics To AMP Pages

August 30th, 2016

AMP Pages are the future for mobile search results. Google has announced recently that they will be removing “mobile-friendly” labels from search results and they also announced that they are testing to show AMP pages with a AMP icon  in the search results.


Hence, soon the AMP pages will move out from the Top Stories section and will be a part of the SERPs. Considering how the mobile usage is exponentially increasing ,  making your site AMP compliant and tracking its performance is a necessity.

In order to add Google analytics to the AMP Pages,  include the following script in the <head>, before the AMP JS library:

<script async custom-element=”amp-analytics”

Add the amp-analytics element to the body of your page. Then to enable the built-in support for Google Analytics, set the type attribute of the amp-analytics element to ‘googleanalytics’. It is recommended to include an id attribute so that you can easily identify each amp-analytics element (e.g. debugging).

<amp-analytics type=”googleanalytics” id=”analytics1″>
Note: It is recommended that you set up and use a separate property for AMP measurement.

Some other vendors offering Analytics For AMP Pages are:

  1. Adobe Analytics –
  2. AFS Analytics  –
  3. AT Internet  –
  4. Chartbeat –
  5. Clicky Web Analytics –
  6. Cxense –
  7. Google Analytics –
  8. INFOnline / IVW –
  9. Krux –
  10. Linkpulse –
  11. Lotame –
  12. mParticle –
  13. Parsely –
  14. Piano –
  15. Quantcast Measurement –


To check if the analytics code is correctly added one can validate the AMP pages  on


Related Posts On AMP:

What Is AMP? All About Accelerated Mobile Pages By Google

AMP Pages To Be Shown In Main Google Search Results – Preview The Experience

Google To Remove Mobile-Friendly Labels and Keep Check On Interstitials For A Better Mobile Search Experience

About The Author

Founder of WebPro Technologies a Web solutions company based in India which focuses on building quality web presence for businesses. Bharati Ahuja is a SEO Trainer and speaker, Web Entrepreneur, Blog Writer, Internet Marketing Consultant.


Digital Marketing Agency India