An AMP page can be served from google search cache inside an iframe using the amp cache/proxy, or directly from amp cache/proxy, or directly from the page URL. How can I sync the amp-analytics CLIENT_ID across these all methods?
I can sync direct amp and non-amp page since the cookie would be saved on the same domain. How to do it in other cases?
Have you tried using AMP Variable Substitutions? Here - https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#client-id
i.e. -
From the documentation ( https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/configure-analytics/analytics_basics/ ) -