Reputation: 1975
I am using GA4 measurement protocol to record offline conversions to Google Analytics. I have two conversion events: sale and purchase.
Events are being recorded and in the Monetisation overview I can even see the revenue.
But it seems that GA is not linking these events with other dimensions of the user. For example in any a report breaking down by some dimension of the user, like user's language or OS or other dimensions, I get something lie this:
Note the language code for all sale and purchase events is "(not set)".
But in the user explorer I can see that the sale and purchase events are correctly associated with the client_ids.
How can I make GA4 to associate events through the measurement protocol with the events recorded on the website from gtag for the same client_id?
Example of the payload for a sale event:
{
"client_id": "1799600509.1659478566",
"timestamp_micros": "1659855760249000",
"events": [
{ "name": "sale", "params": { "first_billing": 1 } }
]
}
Example of the payload for a purchase event:
{
"client_id": "1799600509.1659478566",
"timestamp_micros": "1659855760249000",
"non_personalized_ads":false,
"events": [
{
"name": "purchase",
"params": {
"items": [],
"currency": "USD",
"value": 1.2
}
}
]
}
Upvotes: 2
Views: 1091
Reputation: 1
{
"client_id": "2181226xx.1694508617",
"timestamp_micros": "1694509528000000",
"events": [
{
"name": "purchase",
"params": {
"session_id": "16945086xx",
"transaction_id": "НФНФ-004474",
"value": "409.76",
"currency": "UAH",
"items": [
{
"item_id": "MI05-0553",
"item_name": "xxxxxxxxx",
"currency": "UAH",
"price": "239.67",
"quantity": 1
},
{
"item_id": "MI13-0765",
"item_name": "xxxxxxxx, 50 мл",
"currency": "UAH",
"price": "170.09",
"quantity": 1
}
]
}
}
]
}
I pass the session ID but do not pass the session number. in my reports there is a source channel (I don’t know how correct it is), but all the other properties are "not set". http://joxi.ru/E2pB6Eds7KWJzr http://joxi.ru/bmo05EWI3RBEB2
Upvotes: 0
Reputation: 23
It seems like the GA4 MP documentation is off. In addition to the client_id under the root object, you should also add the latest client session_id and session_number params (under the params object of each event).
This should fix the linking of the client device and other dimensions. Checkout this bug report which shows an example of exactly what you're trying to get. https://issuetracker.google.com/issues/243678686
I think that Kevin from the google team didn't get the point right and rejected that report.
Upvotes: 0
Reputation: 117321
The measurement protocol for ga4 is locked down a lot more then the one for UA was.
Things like language code can not be set via the measurement protocol so will appear as not set.
Until the team decides to open up more for the measurement protocol there's not much that can be done about it other then to use the sdks they supply rather than the measurement protocol directly.
You may want to fill out this and add your voice to the request that they add open up for things.
Upvotes: 1