Skip to content

Add support for GA4

bgm requested to merge bgm/webtracking:ga4 into master

The old GA is deprecated, so this is an attempt at supporting GA4.

I tried to keep it fairly close to the original, but I don't know much about GA old/new APIs, so I mostly just implemented what I was asked to implement. The "ecommerce tracking" code in this PR is probably a bit confused at the moment (will fix it soon-ish).

I also need to track the user_id, so I might add a setting for supporting that, because it's an additional level of creepy / potential PII exchange.

(I think the previous implementation tried to be privacy-sensitive, but if a site is using a tool like GA, they probably don't care about privacy and just want to track their conversions and having too many options just creates incoherent data and confuses admins.)

cc @mattwire @JonGold fyi

Merge request reports