8

I am trying to log custom events with a Facebook Chatbot I have developed, however I cannot for the life of me find a reference for the custom_events types.

The example listed on their reference shows fb_mobile_purchase as a custom eventName. I don't want that, and I can't find anywhere that lists other types.

I want to be able to track when the chatbot sends the user a specific message, but just setting the eventName to anything results in an event name in the Analytics as Reserved5.

Is there a reference to eventNames anywhere within Facebook Documentation?

Alex McCabe
  • 1,852
  • 2
  • 20
  • 33
  • The very definition of “custom” here is that _you_ specify how the event should be named. _“I want to be able to track when the chatbot sends the user a specific message”_ – why would you need to track that using events? It is _your bot_ that sent the message, so you already know that it has happened. – CBroe Feb 24 '17 at 12:36
  • Unfortunately, as I stated above, the custom name shows up as `Reserved5` in the analytics. I need to be able to track when a specific message is sent to the user, as it stands, the analytics only says that _any_ message was sent, but not what that message was. – Alex McCabe Feb 24 '17 at 13:12

2 Answers2

1

You could consider using Chatbase for bot analytics (free to use), which has a Custom Events API.

Justin Kestelyn
  • 924
  • 5
  • 12
0

Currently the docs give this as an example request:

var request = require('request');

request.post({ 
  url : "https://graph.facebook.com/<app_id>/activities",
  form: {
    event: 'CUSTOM_APP_EVENTS',
    custom_events: JSON.stringify([{
      _eventName: "fb_mobile_purchase",
      _valueToSum: 55.22,
      _fb_currency: 'USD'
    }]),
    advertiser_tracking_enabled: 0,
    application_tracking_enabled: 0,
    extinfo: JSON.stringify(['mb1']),
    page_id: <page_id>,
    page_scoped_user_id: recipientId
  }
}, function(err,httpResponse,body){ 
  console.error(err);
  console.log(httpResponse.statusCode);
  console.log(body);
});

So, when the bot is sending that specific message you want to keep an eye out for, fire that message but with a different _eventName, and if needed other parameters.

Keep in mind, by recipientId they mean the PSID of the user the bot is sending the message to.

Sam H.
  • 4,091
  • 3
  • 26
  • 34