bulky-kilobyte-26698
12/19/2023, 2:50 PMcurl -u WRITE_KEY: -X POST https://track.mydomain.com/v1/track \
--header "Content-Type: application/json" \
--data-raw '{
"client_id": "1062148654.1696677236",
"context": {
"ip": "XXXXX"
},
"event": "Purchase completed",
"messageId": "97e640c4-b430-4e47-b6e7-fb1e87028654",
"properties": {
"body_length": 160,
"category": "real-estate",
"id": 69319,
"market": "ma",
"payment_method": "card",
"title_length": 16,
"type": "text",
"vas_local_value": 250,
"vas_type": "urgent-question",
"vas_value": 25
},
"type": "track",
"userId": "email@gmail.com"
}'
This results into RS seeing this payload:
{
"context": {
"ip": "XXXXX"
},
"event": "Purchase completed",
"messageId": "97e640c4-b430-4e47-b6e7-fb1e87028654",
"properties": {
"body_length": 160,
"category": "real-estate",
"id": 69319,
"market": "ma",
"payment_method": "card",
"title_length": 16,
"type": "text",
"vas_local_value": 250,
"vas_type": "urgent-question",
"vas_value": 25
},
"rudderId": "b03abccb-e0b5-46e7-a1fc-82e04b988420",
"type": "track",
"userId": "email@gmail.com"
}
and on GA4 this is what gets sent:
{
"body": {
"XML": {},
"FORM": {},
"JSON": {
"events": [
{
"name": "Purchase_completed",
"params": {
"id": 69319,
"type": "text",
"market": "ma",
"category": "real-estate",
"vas_type": "urgent-question",
"vas_value": 25,
"body_length": 160,
"title_length": 16,
"payment_method": "card",
"vas_local_value": 250,
"engagement_time_msec": 1
}
}
],
"user_id": "email@gmail.com",
"client_id": "b03abccb-e0b5-46e7-a1fc-82e04b988420",
"timestamp_micros": 1702996946000000
},
"JSON_ARRAY": {}
},
"type": "REST",
"files": {},
"method": "POST",
"params": {
"api_secret": "XXXXXX",
"measurement_id": "G-XXXXXXX"
},
"userId": "",
"headers": {
"HOST": "www.google-analytics.com",
"Content-Type": "application/json"
},
"version": "1",
"endpoint": "https://www.google-analytics.com/mp/collect"
}
As you can see client_id gets the value of rudderId.
The idea of client_id is for Google to know which user did what action on Google ads as well, so they know how to retarget and how to optimize for acquisition for Purchase.
But rudderId hijacking that value defies the purpose of cross platform tracking.
Finally, the event above doesn’t show up on GA4 at all, I’m not sure why is that and what am I doing wrong?millions-activity-52391
12/19/2023, 2:50 PMmillions-activity-52391
12/19/2023, 3:56 PM`rudderanalytics.setAnonymousId(<client_id>); `bulky-kilobyte-26698
12/19/2023, 3:57 PMbulky-kilobyte-26698
12/19/2023, 4:00 PMmillions-activity-52391
12/19/2023, 4:02 PMbulky-kilobyte-26698
12/19/2023, 4:02 PMmillions-activity-52391
12/19/2023, 4:04 PMbulky-kilobyte-26698
12/19/2023, 4:09 PMmillions-activity-52391
12/19/2023, 4:22 PMbulky-kilobyte-26698
12/19/2023, 4:22 PMbulky-kilobyte-26698
12/19/2023, 4:23 PMbulky-kilobyte-26698
12/19/2023, 5:02 PMmillions-activity-52391
12/27/2023, 2:35 PMmillions-activity-52391
12/27/2023, 3:00 PMmillions-activity-52391
12/27/2023, 3:04 PM