I’m trying to run a test event in Graph API explorer before integrating it to our website.
I’m having a problem not receiving the test event but the response is not showing any error.
{
"data": [{
"event_name": "PageView",
"event_time": 1611631182,
"action_source": "website",
"event_source_url": "https://example.com",
"user_data": {
"client_ip_address": "1.2.3.4",
"client_user_agent": "test ua"
}
}],
"test_event_code": "TEST12345"
}
I try to include the Email (em) parameter inside the user_data with the value that is generated by default in Payload Helper. It works fine. But when I generate a different email hash, it’s NOT working.
I’m using v9.0 in the API. I hope some could help me solve the problem.
Thanks!
2
Answers
I broke my head with this for quite some time, I ended up sending the
Fbp
cookie in mine and the cAPI tests began picking up these requests.I am actually doing pure offline events so the only parameter I’m sending across is the
fbp
parameter,action_source = other
,event_name
andevent_time
Hopefully this helps someone!
It seems that the user data in your payload needs to contain "real" data.
In your example, try using a real
client_user_agent
value (like the one below).Alternatively, are you certain that you’re hashing the email correctly? Compare your email hash against a SHA256 hash from this website to ensure you’re hashing it correctly.
For example, if you’re using JavaScript’s
crypto
library to do the SHA256 hash, you need to usehex
encoding, notbase64
encoding:In my case, the events weren’t appearing because I hadn’t included IP address & user agent in the payload OR I had included the right fields but set an invalid user agent.
This payload works for me:
Note: you’ll need to update the
test_event_code
andevent_time
fields (because the Conversions API only accepts events sent in the last 7 days)Credit to MatÄ›j’s answer on the Facebook Developers Community forums for providing a working example payload and the insight into providing real data