Hey there!
Hey there!
We utilize the Zaraz API, but only for our 'purchase' conversion events, and this data gets sent to GA4 through Zaraz
We are having an issue where the purchase events tracked through the Zaraz API do not have any device data.
Where all other events contain data like "category": "mobile", "operating_system": "iOS", etc. - these Zaraz API events all show up as "desktop" and are missing device info: (see screenshot)
In the Zaraz API event, we are making sure to pass through the device.user-agent, where we would expect all of this information to be derived from.
Any ideas what we're doing wrong, or how to get this data through the Zaraz Events API?

8 Replies
Can you share more details about how you've configured your Zaraz Actions for GA4?
@Mackenly Sure - we are calling the API with the following payload: (See screenshot)
This includes the system.device properties(including the user-agent)
Is there any other data needed here in order for GA4 to derive the correct device data?

(this triggers the default 'Order Completed' ecommerce event in Zaraz)
Are you using the HTTP Events API? https://developers.cloudflare.com/zaraz/http-events-api/
Cloudflare Docs
HTTP Events API
The Zaraz HTTP Events API allows you to send information to Zaraz from places that cannot run the Web API, such as your server or your mobile app. It is useful for tracking events that are happening outside the browser, like successful transactions, sign-ups and more. The API also allows sending multiple events in batches.
@Mackenly Yes - correct, that's what I am talking about here.
We are using the Zaraz Events API, and passing through the data I previosuly showed in the screenshots, however, we are not getting any device data in GA4.
Is there anything we need to include outside of the user-agent in order to get this device data?
@Mackenly Any ideas here?
Are we missing any necessary fields here?
@Mackenly Just checking in again here?
Curious if you have any ideas on how to get Zaraz to pass the correct device data to GA4 when using the HTTP Events API?
I'll try to take a look and replicate. I don't work for Cloudflare so limited in time.
Oh gotcha!
My apologies! You're so active, I assumed you were!!
@jeremy Yeah, wish I was! Want to follow up to say I haven't forgot and do want to know what's going on with this as well. Hope to share some findings soon.
@jeremy I looked at this pretty in depth, and it seems the solution is quite simply to pass the user agent string as a header with your post request called
User-Agent
.
Ignore what the docs say about passing a user agent string on system.device.user-agent
. That doesn't seem to be right and seems to have no impact on anything.
If you pass it along as a header, it behaves the same way that track requests from browsers work. With those Zaraz reads the User Agent from the headers and parses them and eventually surfaces that data for MCs to read. It seems to work the same way for the HTTP Events API too, but it isn't documented to say to do it that way.