Today, Google Ads Liaison Ginny Marvin announced that Accelerated Mobile Pages (AMP) support is now available for all websites in Google Analytics 4 (GA4).
Marvin stated,
“Today, we’re rolling out support for AMP in GA4 to all publishers. A simple update to your amp-analytics configuration will enable analytics to start flowing immediately into GA4.”
AMP & GA4 Integration Details
While AMP pages are similar to HTML and work in any browser, they don’t support the gtag.js used in Google Analytics. Instead, a separate tag is explicitly provided for AMP.
User identification for AMP is different as well. In GA4, user identifiers are randomly generated and stored in local storage or cookies.
The user identifier is reset when the user clears cookies and local storage. That means IP masking is unnecessary, as IP addresses aren’t logged or stored in GA4.
Requirements
To collect data, you must implement the AMP Analytics tag. AMP Analytics collects page data, user data, browsing data, browser data, interaction data, and event data.
Additionally, Google requires all websites to disclose to users how data is collected and used in GA4 and provide an option to opt out.
Limitations
GA4 has some limitations regarding AMP. It doesn’t support consent mode settings, dynamic configuration, ecommerce events, or additional enhancements available in standard Google Analytics.
More AMP capabilities will be added over time, according to Google.
Google AMP Client ID API & Cache Analysis
It’s worth noting that Google recently introduced the AMP Client ID API to track users across AMP pages better.
Until now, if a user interacted with your content on both your website and through Google viewers like the Google AMP viewer or Google Search, they would appear as two separate users in your analytics since the content was being served in two different contexts.
The AMP Client ID API allows you to associate a consistent identifier with a single user across these contexts to gain a complete view of their engagement with your AMP content regardless of where it’s served.
Next Steps
You can configure Analytics to track how users interact with your AMP pages on Google’s cache versus your website.
To do so, follow these steps:
- Add the following code to the Analytics tag on your AMP pages:
vars: {
'ampHost': '${ampdocHost}'
}
- In your Google Analytics 4 property, set up a custom parameter named “ampHost” to track where the AMP page is served.
- Relaunch your AMP pages for the changes to take effect.
Once you’ve completed those steps, GA4 will track whether each AMP pageview came from your domain or the Google AMP cache and send that information to your reports under the “ampHost” custom parameter.
This can provide visibility into user engagement across the contexts in which your AMP content is served.
For more on GA4 & AMP, see Google’s official help document.
Featured Image: Postmodern Studio/Shutterstock