-
Notifications
You must be signed in to change notification settings - Fork 124
Description
Describe the bug
GA4 supports enhanced conversions via passing user_data to the measurement protocol (or via GTAG),
As far as I can tell though there's no way to set this up for the GA4 destination, or to have it hash the PII according to google's specification.
This will be extremely useful because if setup correctly we don't have to use the enhanced conversions API, we can just import the GA4 events into Google Ads, and the events bring the hashed PII/matching data with them.
To Reproduce
If you pass user_data
to a track call, it will just be embedded as props for the call to GA4 for cloud mode. Likewise the same thing occurs in device mode.
Expected behavior
We should pass the hashed PII to the measurement protocol API for server side GA4 events.
https://developers.google.com/analytics/devguides/collection/ga4/uid-data
We will also need to pass a user_id
, I'm unsure if the JS SDK already does this but I'm assuming we could just use userId
and fallback to anonymousId
, same goes for the cloud side.
And for device mode we should call gtag('set', 'user_data', {...})
and let gtag.js handle hashing and publishing of PII data to GA4 for us (I believe the Rudder-Google Analytics tag can already be configured to do this on identify
calls).
Screenshots
N/A
Additional context
This will allow many people to greatly simplify their tracking setups across GA4 and Google Ads, eliminating the need (in many cases), to use the enhanced conversions API at all (or any other Google Ads destination for that matter), as the PII can be sent to GA4 with the original event bundles.
The problem I'm personally having right now is I would like to be able to use the GA4 destination in hybrid mode (for additional resilliency), but still have the ability to send PII to google. If I switched to device mode I believe I could make it work (by ensuring that I call gtag('set', 'user_data', ...)
but then I lose the benefits of server side publishing for circumventing adblockers.