I'm trying to send some events from the backend of my website to GA. I've collected client_id
from the client, and I send the purchase
event using the following request:
POST /mp/collect?api_secret=xxxxxxxxxxxxxxxxxxxxxxxxxx&measurement_id=G-XXXXXXXX&measurement_id=G-XXXXXXXX HTTP/1.1
{
"client_id": "1079763317.1697693644",
"events": [
{
"name": "purchase",
"params": {
"currency": "IRR",
"transaction_id": "78248861",
"value": "8792000",
"coupon": null,
"items": [
{
"item_name": "Item 1",
"price": "4396000",
"item_category": "ADL",
"quantity": 1,
"item_variant": "Variant 1"
},
{
"item_name": "Item 1",
"price": "4396000",
"item_category": "ADL",
"quantity": 1,
"item_variant": "Variant 2"
}
]
}
}
]
}
The request is being accepted successfully with the code 204
. I have the log for all the requests and I'm sure that this request is being sent and accepted this way more than 7000 times daily.
But when I see the reports in GA, the count of this events are a lot less than what it should be, maybe about 800. It means that somehow a lot of these events are being missed.
Do you have any idea that what's wrong here?
value and price values must be a number (without quotes).
transaction_id must be unique.
item_id is required.