Meta App Events

📘

Meta App Events enable you to view analytics, measure Meta Ad performance, and build audiences for Meta Ad targeting using the Facebook SDK.

If enabled, and properly configured for your app, the Median App Studio will automatically integrate the native iOS and Android Meta 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

Meta 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 Median App Studio under "Facebook App Events".

Median App

Add your Facebook Application ID and Facebook Display Name from your Facebook Developer Account to your Median 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
You can enable this in the plugin settings. Alternatively, you can also 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'
	}
};
median.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'
};
median.facebook.events.sendPurchase(data);

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