Hi, team tagDiv.
You people referred to this link several times in the posts that I’ve gone through before posting this one.
This is the link—
https://developers.google.com/analytics/devguides/collection/amp-analytics/
But in this link the code that’s supposed to measure the traffic contains two scritps and one other tag. This is what google suggest website owners to paste in their website’s code.
But you people suggest to remove the scripts and all the other tags and to keep just the JSON code.
The code that you suggest pasting doesn’t work.
I’ve tried pasting this code in the amp plugin alone and in the amp section of theme panel alone and in the both amp plugin and themepanel’s amp section at once. But nothing worked.
What should I do now?
I have made a separate property (with same domain name) for amp pages and used a separate analytics ID. Can you explain the entire and perfect procedure that can be followed to see how much traffic is coming to amp pages?
Hi,
The code must have this format basically – https://prnt.sc/oog3yz It should be loaded in AMP pages, check with the inspector – https://prnt.sc/oog4l7
The required tags are loaded by the theme automatically.
The theme simply loads the desired analytics code, for more on how to analyze the data you could check some guides. Maybe these are helpful
– https://www.mediavine.com/tracking-amp-traffic-using-google-analytics-segments/
– https://www.tatvic.com/blog/track-amp-google-analytics/
Thanks
Hi Simon,
The code for the amp analytics, provided by Google, looks like this.
{
"vars" : {
"gtag_id": "<GA_MEASUREMENT_ID>",
"config" : {
"<GA_MEASUREMENT_ID>": { "groups": "default" }
}
}
}
It’s different from the one you mentioned as an example in the screenshot. There is no account property but gtag property instead in vars object. There’s a lot of difference. Which code should I use? Please help me out.
One more thing, I am using a different property to track amp traffic. Which url should I use? domain.com or domain.com/?amp
-
This reply was modified 7 years by
Prateek.
Hi,
Just make sure that this code is from your google account, because this seams to by as in this documentation , just make sure that the structure is thr same and set it in AMP analytics;
Also there should be good to use the domain.com to motorization the amp traffic.
Thank you!