简体   繁体   中英

Events not being logged in with AppEventsLogger

I'm trying to use react-native-fbsdk for Facebook analytics. When I go to the events debugging page to check if it works, I can see a couple events like App Activation and App Installs and other stuff like Completed App Session . Of these, I'm manually logging App Activation whereas the rest is I think the sdk provides by default. The problem is, it's not logging many other custom events that I'm trying to log. How do I debug this? Thanks in advance.

When you send the custom events, are you setting the page_scoped_user_id correctly? Here is a raw JSON cutom event, per docs .

{ 
  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
  }
}

The last value, recipientId , is misleading. If you want to log something the user sent, you would want to log the senderId property of that incoming message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM