For the complete documentation index, see llms.txt. This page is also available as Markdown.

Facebook App Events API

Track user actions with the WebToNative Facebook App Events API. Integrate event logging to measure app engagement and conversions.

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

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"
    }
})
import { send } from "webtonative/Facebook/events"

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:

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

Last updated