Skip to content

Instantly share code, notes, and snippets.

@chriswburke
Forked from anonymous/Sitecore AMP Call
Created March 1, 2017 16:24
Show Gist options
  • Save chriswburke/5ff9f0ba66cf8e82131ef59688ab5fb1 to your computer and use it in GitHub Desktop.
Save chriswburke/5ff9f0ba66cf8e82131ef59688ab5fb1 to your computer and use it in GitHub Desktop.
<amp-analytics>
<script type="application/json">
{
"requests": {
"pageview": "https://keystone.sitecore81u1/?url=${canonicalUrl}&title=${title}&acct=${account}",
"event": "https://keystone.sitecore81u1/?eid=${eventId}&elab=${eventLabel}&acct=${account}"
},
"vars": {
"account": "ABC123"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"trackAnchorClicks": {
"on": "click",
"selector": "a",
"request": "event",
"vars": {
"eventId": "42",
"eventLabel": "clicked on a link"
}
}
}
}
</script>
</amp-analytics>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment