Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP Google Analytics and AMP Ids do not match #34300

Closed
demianrenzulli opened this issue May 10, 2021 · 10 comments
Closed

AMP Google Analytics and AMP Ids do not match #34300

demianrenzulli opened this issue May 10, 2021 · 10 comments
Assignees

Comments

@demianrenzulli
Copy link
Contributor

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

@micajuine-ho
Copy link
Contributor

A URL exhibiting this behavior would be very helpful.

@kbarneyforbes
Copy link

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/

dev-ga
dev-pubads

@micajuine-ho micajuine-ho self-assigned this May 11, 2021
@micajuine-ho
Copy link
Contributor

@AndrewKGuan
Copy link

AndrewKGuan commented May 11, 2021

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?

@micajuine-ho
Copy link
Contributor

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?

@micajuine-ho
Copy link
Contributor

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-...

@kbarneyforbes
Copy link

The dev90 link is internal only. I figured out a way to reproduce the issue consistently on prod.

  1. Open a private window
  2. Search on desktop Google for "pfizer ceo albert bourla helped save the world can he save his companys stock"
  3. Click on the article
  4. Go back to the search results
  5. Open up devtools and emulate mobile.
  6. Refresh.
  7. 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

@micajuine-ho
Copy link
Contributor

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?

@micajuine-ho
Copy link
Contributor

Closing now.

@kbarneyforbes
Copy link

Did anything happen with this issue? We were still hoping the mismatched IDs could be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants