October 17, 2016 at 11:31 am | Programming, web, Wordpress.

If you are working on adding AMP pages to your site or using a WordPress plugin like AMP for WordPress with Yoast SEO Amp, remember that your Google Analytics needs to get wrapped in a amp-analytics tag to be properly displayed.

<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
{
  "vars": {
    "account": "UA-XXXXXX-X"
  },
  "triggers": {
    "trackPageview": {
      "on": "visible",
      "request": "pageview"
    }
  }
}
</script>
</amp-analytics>