Analytics
5.5K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

AMP analytics

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We have implemented the AMP pages for our pages and we have used the below GA code to track the amp pages. But in my normal GA account I cannot able to see these amp pages ?? any code change is needed or Have to do some changes in GA account to track those pages.

 

In Head Tag:

<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>

 

In Body Tag:

<amp-analytics type="googleanalytics" id="googleanalytics1">
  <script type="application/json">
        {
            "vars": {
            "account":"UA-XXXXXX-XX"
            },
            "triggers": {
                "trackPageview": {
                    "on": "visible",
                    "request": "pageview"
                }
            }
        }
    </script>
</amp-analytics>

AMP analytics

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Your posted code has some errors. The major point is: there is no valid UA-ID defined. You should change "UA-XXXXX-X" in the UA ID of your property. Log in to GA and use the admin tab, navigate to your property and write down the ID. Set the ID in your pages code accordingly.

 

AMP analytics

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

In website I have added the correct GA ID only. Here I have mentioned as XXXX