Why use Meta App Events?
- Auto events: Enable auto logging for standard events such as App Install and App Launch.
- Custom events: Send custom events (e.g. level achieved, purchases) via the JavaScript Bridge.
- Native SDKs: iOS and Android Meta SDKs integrated by Median App Studio when enabled and configured.
- Ad performance: Measure Meta Ad performance and build audiences for Meta Ad targeting using the Facebook SDK.
Prerequisites
- A Median app with the JavaScript Bridge enabled
- A Facebook Application created in the Facebook Developer Account (for Android, add your app’s release key hash from Median App Studio under Facebook App Events)
- Facebook Application ID and Facebook Display Name from your Facebook Developer Account
Integration guide
Plugin enablement
- Create a Facebook Application within your Facebook Developer Account. For Android, add your app’s release key hash (found in Median App Studio under Facebook App Events).
- Configure in Median App Studio: Add your Facebook Application ID and Facebook Display Name from your Facebook Developer Account to your Median app’s configuration.
Configuration options
JavaScript Bridge functions
Auto events
Enable or disable auto logging for standard events (e.g. App Install, App Launch).Custom events
Regular events
Send a custom event to Facebook. Create a JavaScript object with:- event (required): String that identifies the event type.
- valueToSum (optional): A number to sum up.
- parameters (optional): Object of additional parameters.
Event name and parameter key constants can be found in the Facebook SDK source (Android:
AppEventsConstants.kt; iOS: FBSDKAppEvents.m).
Purchase events
Send a purchase event. Facebook’s SDK sends purchase events more immediately than regular events.Testing checklist
Use this checklist to verify Meta App Events is working correctly before going to production: Basic functionality- Facebook Application created in the Facebook Developer Account
- Facebook Application ID and Display Name added in Median App Studio
- For Android: app release key hash added to the Facebook Developer Account under your app’s Android settings
- Plugin is enabled in Median App Studio and a new app build has been generated
-
setAutoLogging(true)executes without JavaScript errors - App Install event appears in Meta Events Manager after a fresh install
- App Launch event appears in Meta Events Manager after opening the app
-
setAutoLogging(false)disables auto logging as expected
-
median.facebook.events.send()runs without errors and events appear with correct names -
median.facebook.events.sendPurchase()recordspurchaseAmountas a number andcurrencyas a valid ISO code
- All functions are called after
median_library_ready() - JavaScript Bridge is enabled on both iOS and Android test builds
Troubleshooting
Meta App Events functions are undefined or not working
Ensure the JavaScript Bridge is enabled in App Studio. Call allmedian.facebook.* functions after the median_library_ready() event fires. Calling them earlier results in undefined errors.
Also confirm:
- The plugin is enabled in Median App Studio
- A new app build has been generated after enabling the plugin
- Your Facebook Application ID and Display Name are correctly entered in Median App Studio
Events are not appearing in Meta Events Manager
Event delivery can be delayed by up to 15–20 minutes in Meta Events Manager. If events are still missing after waiting:- Verify your Facebook Application ID matches the app you’re checking in Meta Events Manager
- Confirm the event call is executing (add a
console.logbefore themedian.facebook.events.send()call to verify) - Check that the
eventfield in your data object uses a valid event name string — typos will cause events to be dropped silently
Android: events not firing or app crashes on launch
Android requires your app’s release key hash to be registered in your Facebook Application settings. Without it, the Meta SDK will fail to initialize on release builds. To fix this:- In Median App Studio, navigate to Facebook App Events and copy your release key hash
- In your Facebook Developer Account, go to your app → Settings → Basic → Android and add the key hash
- Generate a new app build after making this change
Auto logging is enabled but app install / app launch events are missing
Confirm thatsetAutoLogging(true) is being called after median_library_ready() and before any navigation or lifecycle events you want to capture. App Install events in particular are only sent on the first launch after installation — reinstalling the app is required to trigger it again during testing.
Also verify that auto logging hasn’t been disabled elsewhere in your code with a setAutoLogging(false) call.
Purchase events are not recorded with the correct amount or currency
Ensure thepurchaseAmount field is passed as a number (not a string) and that currency uses a valid ISO 4217 currency code (e.g. 'USD', 'EUR', 'GBP'). Passing an incorrect type or unsupported currency code will cause the event to be dropped or recorded incorrectly.
Still having trouble?For Meta SDK and App Events behavior outside Median’s bridge, refer to the Meta App Events documentation.