AMP Google Analytics and AMP Ids do not match
What's the issue?
Forbes reported that sometimes GA client_Id expands to a different value when it gets sent to GA vs DFP. This is related to FR #25190, which landed in prod earlier this year.
How do we reproduce the issue?
@kbarneyforbes could you provide some details around it?
cc // @micajuine-ho
A URL exhibiting this behavior would be very helpful.
We are sending client_id both to Google Analytics and DFP. The same ID should be sent to both, but it appears that frequently the IDs don't match. Unfortunately, we can't reproduce this consistently.
For GA, the value is sent as CD43. For DFP it's the fvid key/value in the scp parameter.
We noticed that we are using "CLIENT_ID(_ga)" for DFP and "${clientId}" for GA. We tried changing GA to use "CLIENT_ID(_ga)" too, and both to use "CLIENT_ID(AMP_ECID_GOOGLE)", but were still able to reproduce the issue in our testing environment even after that change.
Below are some screenshots showing the values being sent.
This is the internal testing page where those screenshots came from (where we've been able to consistently reproduce the issue). https://dev90.simple-site.forbes.com/sites/nathanvardi/2021/03/12/pfizer-ceo-albert-bourla-helped-save-the-world-can-he-save-his-companys-stock/amp/
Prod version of the same page. https://www.forbes.com/sites/nathanvardi/2021/03/12/pfizer-ceo-albert-bourla-helped-save-the-world-can-he-save-his-companys-stock/amp/

Hi,
https://dev90.simple-site.forbes.com/sites/nathanvardi/2021/03/12/pfizer-ceo-albert-bourla-helped-save-the-world-can-he-save-his-companys-stock/amp/
I'm not able to load this link. Is it still up?
Hi Ken, is the prod version (link in 3rd comment) exactly the same as the internal test one? If so, perhaps Micajuine could try with that one?
Yeah, I'm not able to repro with the prod link. Does the page have to be served from the cache for it to occur?
I think it's interesting that fvid=1831..... If I'm not mistaken, this indicates that its a non-amp generated CID. I'm thinking perhaps Linker/Cookiewriter might be used to propagate an amp-generated CID (maybe from cached page to origin page), but the Cookie already exists on origin, and amp-ad uses it before Linker/Cookiewriter has a chance to update? this could explain why the googleanalytics CID is amp-...
The dev90 link is internal only. I figured out a way to reproduce the issue consistently on prod.
- Open a private window
- Search on desktop Google for "pfizer ceo albert bourla helped save the world can he save his companys stock"
- Click on the article
- Go back to the search results
- Open up devtools and emulate mobile.
- Refresh.
- Click on the amp link to the same article
The IDs I get doing that consistently look like something like this, with only GA/cd43 starting with "amp-". fvid=0Hypp00QDXip0gfS9355DTI32E_H1m09T3TsaUiZTT0Shjw3hpxxzM2Vxrmeung8 cd43: amp-IYH5u8YoLq-KtotIOPWgCFpwE5lqWKL4oF_TH5CXGWwuld0wO2eaqbNoMHUGpNfp
I did some more digging, it looks like amp-analytics is using a config from GTM via config="https://www.googletagmanager.com/amp.json?id=GTM-MNSBDX&gtm.url=SOURCE_URL". This config contains CLIENT_ID(AMP_ECID_GOOGLE,,_ga,true)
Then within your amp-ad type="doubleclick" in the JSON attribute (for RTC callouts) you have "fvid":"CLIENT_ID(_ga)".
I feel like this maybe the issue?
@jeffkaufman @calebcordry For pubs with the setup (amp-analytics using a GTM config and doubleclick ads), is there guidance for what scope the CLIENT_ID within the RTC callout should be? Should they both be AMP_ECID_GOOGLE?
Closing now.
Did anything happen with this issue? We were still hoping the mismatched IDs could be fixed.