Created
July 17, 2019 16:49
-
-
Save Weiyuan-Lane/8ce6ac6c109e65cdb9183b1f17817ccb to your computer and use it in GitHub Desktop.
Example to using amp-analytics in HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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