Skip to content

Instantly share code, notes, and snippets.

@Weiyuan-Lane
Created July 17, 2019 16:49
Show Gist options
  • Save Weiyuan-Lane/8ce6ac6c109e65cdb9183b1f17817ccb to your computer and use it in GitHub Desktop.
Save Weiyuan-Lane/8ce6ac6c109e65cdb9183b1f17817ccb to your computer and use it in GitHub Desktop.
Example to using amp-analytics in HTML
<!-- This is one way to configure amp-analytics for GA -->
<!-- Other vendor support for analyitcs in AMP can be found from here: https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/configure-analytics/analytics-vendors/?format=websites -->
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
"vars": {
"gtag_id": "UA-YOUR-ID-HERE",
"config": {
"UA-YOUR-ID-HERE": { "groups": "default" }
}
}
}
</script>
</amp-analytics>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment