I am trying to implement FB CAPI for my business and I set up a Purchase event and now I want to test it via Event Test Tool. I test it for webpage and EventTest Tool is tracking all the browser event but when i tried to track via server event I am not able to see any history in Server Events Tab. The Request Format is:
Method: POST
Postman URL: https://graph.facebook.com/{{API_VERSION}}/{{PIXEL_ID}}/events?access_token={{TOKEN}}
Request Payload:
{
"data": [
{
"event_name": "Purchase",
"event_time": 1619508577,
"action_source": "email",
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068"
},
"custom_data": {
"currency": "USD",
"value": "142.52"
}
}
],
"test_event_code": "TEST7039"
}
Request Response:
{
"events_received": 1,
"messages": [
],
"fbtrace_id": "AQqIVn-TahE83ocCagd4HKB"
}
As request response is successful but I am not able to see the event in Event Test Tool's tab?
So after alot of testing I came to know that UserAgent and IP address are required values to be passed in user data.
Updated JSON:
{
"data": [
{
"event_name": "Purchase",
"event_time": 1619508577,
"action_source": "email",
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068",
"client_ip_address": "yourIPAddress",
"client_user_agent": "your userAgent"
},
"custom_data": {
"currency": "USD",
"value": "142.52"
}
}
],
"test_event_code": "TEST7039"
}