Reputation: 563
So i followed this guideline and provided session_id with my events sent via Measurement Protocol:
https://developers.google.com/analytics/devguides/collection/protocol/ga4/changelog
The call to the GA4 looks like this:
And I can clearly see that that it's correctly passed with events by looking at the raw data and comparing it with the raw events generated by the official script.
Event sent from backend:
Event sent by the official JS library:
Still, all the events sent via Measurement Protocol aren't attributed to their sources and simply shown as "Unassigned" in the reports.
Honestly, at this point I am about to give up on GA4 and move to something else. While the concepts of new GA are on the right track, everything seems to be broken and poorly documented at this point and I've been trying to make attribution work for quite a while now but to no avail.
Upvotes: 1
Views: 885
Reputation: 139
GA4 MP is absolutely different than UA MP.
It looks like you're trying to simulate GA4 client side behavior from the back end, and it isn't supported. To report events from the server side you have to use GA4 MP API which is Json based and requires secret and measurement id.
Please refer official google docs regarding GA4 MP to send events from the server side. https://developers.google.com/analytics/devguides/collection/protocol/ga4/
Upvotes: 0