Facebook chatbot custom evet tracking does not work

138 views Asked by At

I am currently working on a Facebook chatbot. I wanted to add custom event tracing to it, so I tried the following code (in python, like the back end of the bot)

url = "https://graph.facebook.com/<XXX>/activities"
params = {
    "custom_events": json.dumps([{
        "_eventName": "fb_sent_file",
        "_valueToSum": "1"
    }]),
    "page_id": "<YYY>",
    "event": "CUSTOM_APP_EVENTS",
    "advertiser_tracking_enabled": "0",
    "application_tracking_enabled": "0",
    "extinfo": json.dumps(['mb1']),
    "page_scoped_user_id": "<ZZZ>",
    "access_token": "<XYZ>"
}

from tornado.httputil import url_concat
url = url_concat(url, params)
r = requests.post(url)
print r.json()

This code snippet seems to work fine -- I alwaysget {"success": True} as a response. The event name (fb_sent_file) also appears in the app dashboard, but the count of events remains "0 for ever and does not change, even if I call the script a couple of more times.

So, what could be the problem? I try it with a test app, maybe this? Thanks in advance.

0

There are 0 answers