title: Facebook bot analytics event logging
body: <p>I am currently working on a messenger bot and am trying to log additional events using facebook's app analytics platform.</p>
  
  <p>Relevant documentations:</p>
  
  <ul>
  <li><a href="https://developers.facebook.com/docs/app-events/bots-for-messenger" rel="nofollow noreferrer">Events for messenger bots</a></li>
  <li><a href="https://developers.facebook.com/docs/graph-api/reference/application/activities/" rel="nofollow noreferrer">Activities endpoint documentation</a></li>
  </ul>
  
  <p>Example request (app information censored):</p>
  
  <pre><code>curl -F 'event=CUSTOM_APP_EVENTS' \
   -F 'custom_events=[{"_app_user_id": "1", "_eventName": "my-test-event"}]' \
   -F 'advertiser_tracking_enabled=0' \
   -F 'application_tracking_enabled=0' \
   -F 'extinfo=["mb1"]' \
   -F 'page_id=xxx' \
   -F 'page_scoped_user_id=xxx' \
   -F 'access_token=xxx' \
   https://graph.facebook.com/xxx/activities
  </code></pre>
  
  <p>Problem:</p>
  
  <p>When issuing the request above, the event will appear on my analytics overview (<code>https://www.facebook.com/analytics/xxx/?section=AppEvents</code>) but without the actual event being recorded. The amount of events received stays at zero and the event debugger won't show any activity.</p>
  
  <p>If I send the event without an access token (same request as above, just without the token) the event will get processed correctly.</p>
  
  <p>While I can get it to work this way, I really don't think posting events without an access token should be working at all.. couldn't just everybody post them for my application?</p>
  
  <p>The application is currently still in sandbox mode, so the issue might be related to that. Does anybody have experience with that?</p>
  
  <p>Quick edit: Facebook themselves appear to be sending the request using an access token as seen int he <a href="https://github.com/facebook/facebook-android-sdk/blob/3c606b0efb837ffcc1006e83a09a72049b69dd28/facebook/src/main/java/com/facebook/appevents/AppEventQueue.java#L211" rel="nofollow noreferrer">facebook sdk for android</a>.</p>