• Priority: Medium
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 16.02.21, 13:43
  • Opened by: Vidmantas Dapkus
  • Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #20784 - AMP Google Analytics

I entered GA ID in AMP configuration but I can’t get the analytics data in GA property and I see that this sniped

<amp-analytics type=”googleanalytics”>

<script type="application/json">
    "vars": {
      "account": "G-39LBDFWSS4"
    "triggers": {
      "trackPageview": {
        "on": "visible",
        "request": "pageview"


is loaden in <body> instead of <head>.

Could it be the problem?

As opposite, in website the tag is loaded in <head> and I get analytics without problems

<script type=”text/javascript”>

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          ga('create', 'UA-46920287-2', 'auto');
              ga('set', 'userId', '1189');
                  ga('send', 'pageview');
  ga('require', 'ec');



Fred 16 Feb 2021, 14:31

you don't have to add anything into the code, we already added all codes there
You just need to configure your google analytics for AMP, see the tutorial link in the AMP module settings