quintype / quintype-amp

Quintype's AMP component library for publisher apps to create amp layouts
0 stars 1 forks source link

GA4 support for AMP pages #429

Closed anish-q closed 1 year ago

anish-q commented 1 year ago

As per the reports from SEOs Google is not bringing direct GA4 support for AMP. The most common method used as an alternative is explained in https://www.thyngster.com/how-to-track-amp-pages-with-google-analytics-4. Please implement this feature at the earliest as GA3 is scaled down and is going to be shut down by July 1.

GTM does not have AMP tag support for AMP containers.

shraddha-kesari commented 1 year ago

Spike

  1. Platform team to make change in amp config settings in BOLD. The GA id field to accept value without any conditions.
  2. Write condition for UA- or-else fallback to GA4.
  3. Add new gA4 json file separately rather than picking data from url.
  4. Pick up parameters as a json object from amp featureConfig in frontend.
  5. Test whether the call for id is being made in the network tab of amp story
devasenamurugesan commented 1 year ago

Build: support-amp-ga4-11947 Env: Malibu Staging Test Result - https://docs.google.com/document/d/1R9ZindpP-yBgln4tU3HYSa07TKC8-HmBBm-n46byLqU/edit Moving to QA Complete.

ags1773 commented 1 year ago

@devasenamurugesan not able to view the above doc pls make it public

anish-q commented 1 year ago

Google has finally brought support: https://developers.google.com/analytics/devguides/collection/amp-analytics/

<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
  "vars" : {
    "gtag_id": "<GA_MEASUREMENT_ID>",
    "config" : {
      "<GA_MEASUREMENT_ID>": { "groups": "default" }
    }
  }
}
</script>
</amp-analytics>

<GA_MEASUREMENT_ID> to be replaced with the GA4 measurement ID

shraddha-kesari commented 1 year ago

This is LIVE