Facebook App Events

You'll need to import the javascript file in your website before starting from this .

Automatically Logged Events

When using the Facebook SDK, certain events in your app are automatically logged and collected for Facebook Events Manager unless you disable automatic event logging. These events are relevant for all use cases - targeting, measurement and optimisation. Learn more about Automatically Logged Events : Android: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#auto-events iOS: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#auto-events

Manually Log Events(Custom Events)

1) Regular Events To send a custom event to Facebook, create a javascript object with the fields:

const { events: FacebookEvents} = window.WTN.facebook

FacebookEvents.send({
    event: "MY_EVENT", 
    valueToSum: 10, //optional
    parameters: { // optional
        name: "webtonative"
    }
})

2) Purchase Events There is a special case for purchases and Facebook's SDK will send the event more immediately:

const { events: FacebookEvents} = window.WTN.facebook

FacebookEvents.sendPurchase({
    amount: 3.14, 
    currency: "INR",
    parameters: { // optional
        name: "webtonative"
    }
})

The list of string constants for event names and parameter keys can be found here:

Last updated