Facebook App Events
Facebook App Events enable you to view analytics, measure Facebook Ad performance, and build audiences for Facebook Ad targeting using the Facebook SDK.
If enabled, and properly configured for your app, the GoNative App Builder will automatically integrate the native iOS and Android Facebook SDKs within your app. You can then use Facebook's App Events to receive automatic logging and custom events. The native SDKs provide more events than possible through the web-based Facebook pixel.
Configuration
Facebook Developer Account
You will need to create a Facebook Application within your Facebook Developer Account at https://developer.facebook.com. For Android you will need to add your app's release key hash value which is found within the GoNative App Builder under "Facebook App Events".
GoNative App
Add your Facebook Application ID and Facebook Display Name from your Facebook Developer Account to your GoNative app's configuration.
Logging and Events
Auto Events
You can enable auto logging to send a set of standard events such as App Install
andApp Launch
To enable add the following parameter to your appConfig.json services.facebook.autoLogging: true
Learn more about Auto events:
https://developers.facebook.com/docs/app-events/getting-started-app-events-android#auto-events
Custom Events
Regular Events
To send a custom event to Facebook, create a javascript object with the fields:
- event: the string that identifies the event type
- parameters (optional): an object of additional parameters
- valueToSum (optional): a number to sum up
For example:
var data = {
event: 'fb_mobile_level_achieved',
parameters: {
'fb_level': '1'
}
};
gonative.facebook.events.send(data);
Purchase Events
There is a special case for purchases and Facebook's SDK will send the event more immediately:
var data = {
purchaseAmount: 2.56,
currency: 'USD'
};
gonative.facebook.events.sendPurchase(data);
The list of string constants for event names and parameter keys can be found here:
Updated about 1 year ago