Google Posts a Guide on Tracking Cross-Origin User State Between Your Domain and AMP Cacheshttps://blog.amp.dev
This article will teach you how to track user actions between your domain and AMP Caches. Users can access your site not just on your domain, but also on Google’s cache domain. If a user visits your site on an AMP cache and again on your own domain, it’s important to recognize that both visitors are the same person.
The solution is twofold. On your domain, identify users with a session cookie, just as usual. On the cache and on a browser that accepts third-party cookies, do the same. Otherwise, whenever a user takes an action that modifies application state, redirect them immediately (using AMP-Redirect-To ) to your origin, where you can access or create a cookie stored under your domain, and then make the change desired.
Do I really need to do this? You may not. But as browsers block third-party cookies in more and more cases, this solution will increasingly be essential to let users use your site smoothly across your origin and AMP caches.