analytics-debugger / google-analytics-4-for-amp

Google Analytics 4 Support For AMP
MIT License
60 stars 17 forks source link

How to get page id #26

Open riteshpallod opened 1 year ago

riteshpallod commented 1 year ago

I am very clueless on how to get the page id setup, I see from documentation it has to be around &_p but do not how to use it. can you please help?

the default snippet of "vars" works. Just that I want to track the % page views completed.

    <amp-analytics type="gtag" data-credentials="include">
      <script type="application/json">
        {
          "vars": {
            "GA4_MEASUREMENT_ID": "G-XXXX",
            "GA4_ENDPOINT_HOSTNAME": "www.google-analytics.com",
            "DEFAULT_PAGEVIEW_ENABLED": true,
            "GOOGLE_CONSENT_ENABLED": false,
            "WEBVITALS_TRACKING": false,
            "PERFORMANCE_TIMING_TRACKING": false,
            "SEND_DOUBLECLICK_BEACON": false
          }
      </script>

Also GA4 and AMP is a mess, thanks a lot for this work man :)

thyngster commented 1 year ago

I don't really what do you mean. If you could explain it further it would be great.