Use one of the examples below to track events on your AMP pages.
Add custom parameters to the extraUrlParams
property to save them into your collection.
Login to Keen to create a project and grab the Project ID and Write Key from your project's Access page.
-
Simple - basic example of the page view tracking. Demo @JSFiddle
-
Remote configuration - define remote configuration to use the same code on different websites. Demo @JSFiddle
-
Vendor configuration - the default page views tracking configuration provided by Keen. Demo @JSFiddle
https://www.ampproject.org/docs/reference/components/amp-analytics#triggers
https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md