Thanks! Does this code come installed with the plugin or do I have to add it somewhere?
<script async custom-element="amp-analytics"
src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
That will automatically be added by the plugin when you configure analytics in the admin.
Hi Laura and Weston,
I was manually adding the Analytics related code in the single.php file under AMP plugin files, but I’ve seen in the last version that file’s structure has slightly changed. So I’ve finally opted for adding the simplest Analytics option via the admin menu you mention here. Hope everything works fine also this way, thanks guys!
Hi All,
In JavaScript code I can add this line to track user time, exactly change Bounce Rate counting from Page Views to time on the website:
setTimeout(“_gaq.push([‘_trackEvent’, ’15_seconds’, ‘read’])”,15000);
I have a question how to switch it to Json format ?
And My Second Question is, Can I prepare similar Json File for another Analytics method like StatCounter ?
Regards,
-
This reply was modified 8 years, 2 months ago by
otiss.
@otiss This would be a better question for the Google Analytics support forums, specifically in regards to the supported AMP interactions: https://developers.google.com/analytics/devguides/collection/amp-analytics/#supported_user_interactions_for_google_analytics