(gtag) for AMP No triggers were found in the config. No analytics data will be sent

1.3k views Asked by At

Try to setup google gtag to amp page. But always receive an error:

[AmpAnalytics gtag] No triggers were found in the config. No analytics data will be sent.

i get example code from https://developers.google.com/gtagjs/devguide/amp setup my GA_TRACKING_ID

<amp-analytics type="gtag" data-credentials="include" id="gtag">
  <script type="application/json">
    {
      "vars": {
        "gtag_id": "<GA_TRACKING_ID>",
        "config": {
          "<GA_TRACKING_ID>": {}
        }
      },
      "triggers": {
        "button": {
          "selector": "#the-button",
          "on": "click",
          "vars": {
            "event_name": "login",
            "method": "Google"
          }
        }
      }
    }
  </script>
</amp-analytics>

As u can see triggers is here, but this error always appear.

Thank you in advance for any and all assistance!

1

There are 1 answers

0
holla_a_m_ego On

AMP integration with Google Analytics 4 (GA4) is still under development.

Follow the discussion here. Link to the parent issue