managed-components / google-analytics-4

Google Analytics 4 Managed Component
Other
19 stars 7 forks source link

Update and fix audiences request #38

Open wuservices opened 3 weeks ago

wuservices commented 3 weeks ago

The current audience request for GA4 audiences from this MC does not work and is not a valid request for GA4.

We were using this and seeing 0 data in Google Ads, and Google Ads support noticed we were not sending a request with v=2, which is sent for GA4 audience requests. v=1 is the legacy version associated with (now dead) Universal Analytics.

We see v=1 in this MC, https://github.com/managed-components/google-analytics-4/blob/a37816ab86a7750cab6ef8546707365e08bde2db/src/index.ts#L23

but the implementation and data structure looks like it was copied from the Universal Analytics MC logic.

If I run the Google Tag, I see a request like this with v2, and different fields:

https://analytics.google.com/g/collect with the following parameters:

There are multiple reports of issues with Zaraz GA4 and audiences in #zaraz Discord.

There's also a request made for https://td.doubleclick.net/td/ga/rul with many params, which isn't part of this MC. Not sure if that's for a different type of tracking though.

m-muiznieks commented 1 day ago

Yes, this is a thing for me as well.