Today: Google Ads Contact Ginny Marvin announced Accelerated Mobile Pages (AMP) support is now available for all websites in Google Analytics 4 (GA4).
Marvin explained:
“Today we are rolling out support for AMP in GA4 for all publishers. With a simple update of your amp-analytics configuration, analytics can flow straight into GA4.”
AMP and GA4 integration details
Although AMP pages are similar to HTML and will work in any browser, they do not support the gtag.js used in Google Analytics. Instead, a separate tag is explicitly provided for AMP.
The user identification for AMP is also different. In GA4, user identifiers are randomly generated and stored in local storage or in cookies.
The user ID is reset when the user clears cookies and local storage. This means that IP masking is not required as IP addresses are not logged or stored in GA4.
Requirements
To collect data, you must implement the AMP Analytics tag. AMP Analytics collects page data, user data, browser data, browser data, interaction data, and event data.
In addition, Google requires all websites to disclose to users how data is collected and used in GA4 and to provide an option to opt-out.
restrictions
GA4 has some limitations regarding AMP. Consent mode settings, dynamic configuration, e-commerce events, or additional enhancements available in standard Google Analytics are not supported.
According to Google, more AMP features will be added over time.
Google AMP Client ID API and Cache Analysis
It’s worth noting that Google recently introduced the AMP Client ID API to better track users across AMP pages.
Previously, when a user interacted with your content both on your website and through Google viewers such as the Google AMP Viewer or Google Search, your analytics showed them as two separate users because the content was served in two different contexts.
With the AMP Client ID API, you can assign a consistent identifier to a single user in these contexts for a complete view of their interaction 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 in Google’s cache compared to your website.
To do this, follow these steps:
- Add the following code to the analytics tag on your AMP pages:
vars: {
'ampHost': '${ampdocHost}'
}
- Set up a custom parameter called “ampHost” in your Google Analytics 4 property to track where the AMP page is served.
- Restart your AMP pages for the changes to take effect.
Once you complete these steps, GA4 tracks whether each AMP pageview is from your domain or the Google AMP cache and sends this information to your reports under the ampHost custom parameter.
This can provide insight into user interaction in the contexts in which your AMP content is served.
For more information on GA4 and AMP, see Google’s official help document.
Featured image: Postmodern Studio/Shutterstock