Wednesday, November 29, 2023
HomeWeb AnalysisWhat is a simple trial of AMP version Google Analytics?

What is a simple trial of AMP version Google Analytics?

The AMP version of Google Analytics has been released, and we have released a site where you can easily try the AMP version of Google Analytics for those who are involved in access analysis and want to try it.


AMP (Accelerated Mobile Pages), a project launched by Google to make mobile sites explode, is starting to become a hot topic among web developers and others. Even in Japan, publishers such as Asahi Shimbun and Mainichi Shimbun are gradually creating pages that support AMP.

Although AMP has restrictions on the use of JavaScript by default, an iframe was required to introduce Google Analytics, but in February 2016, the AMP version of Google Analytics was released, and without using iframes. , you can now install Google Analytics on your AMP site.

However, the AMP version of Google Analytics has a completely different description method from the conventional tracking code, so we made it possible to try out the AMP version of Google Analytics in a simple manner.

How to install AMP version of Google Analytics

As a premise, the page must be compatible with AMP. When making a page compatible with AMP , I think it’s a good idea to implement it while referring to the official: Accelerated Mobile Page Project . On top of that, the procedure for setting up Google Analytics for AMP pages is

  1. Load AMP compatible Google Analytics library (JavaScript)
  2. Add the >amp-analytics< tag
  3. Describe the measurement contents in the >amp-analytics< tag

That’s the flow. The implementation method of 3 is completely different from the JavaScript version of the tracking code so far, so you need to learn new things. For example, the >amp-analytics< tag for simply measuring page views is

<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
  "vars": {
    "account": "UA-XXXXX-Y"  // Replace with your property ID.
  "triggers": {
    "trackPageview": {  // Trigger names can be any string. trackPageview is not a required name.
      "on": "visible",
      "request": "pageview"

It will look like this.

Although it has the disadvantage of being less flexible than the normal JavaScript version of the tracking code,

  • There is no variation in how the tracking code is written among implementers, and it is easy to unify
  • Since it can be written in JSON format, it is easy for implementers to validate
  • Full support for event tracking, custom dimensions, etc.

There is a feature.

How to use the simple trial

We have created a special site where you can easily try the AMP version of Google Analytics for those who want to use the AMP version of Google Analytics but do not have such a site.

This special site has a very simple structure of 2 pages.

  • AMP Analytics Config
    • This page does not support AMP.
    • The AMP version Google Analytics tracking code installed in the text area of ​​this page will be executed.
    • It contains the default tracking code.
  • Welcome to the mobile Web
    • This page is a page implemented with AMP.
    • When you set the tracking code in “AMP Analytics Config” and click the link to transition to this page, the set content is set in the tracking code and the page is displayed.
    • The page has not been created at all, but some classes/ids have been assigned, so please check with developer tools.

The capture below shows what the page view sent when running with the default tracking code. You can see that the required data is being sent properly.


The Accelerated Mobile Pages project announced as the importance of the mobile web accelerates. Even if it is placed on the Google search engine in Japan, it will support AMP in the second half of February 2016 at the earliest, so if you are interested, why not consider AMP support?


Leave a reply

Please enter your comment!
Please enter your name here

Recent Posts

Popular Posts

Most Popular

Recent Comments