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

Facebook

Track app installs and in-app activity, and measure ad performance for your Facebook and Instagram campaigns.

What is Facebook Analytics?

Facebook (Meta) Analytics lets you track how users interact with your app and measure the performance of your Facebook and Instagram ad campaigns. It logs standard events automatically (app installs, sessions, purchases) and lets you send custom events to understand deeper engagement.

Prerequisites

  • iOS:

    • Your iOS app is already published in the Natively Dashboard.

  • Android:

    • Your Android app is already published in the Natively Dashboard.

    • Your app is uploaded to the Google Play Console - required to access SHA-1 signing certificate fingerprints.

Facebook Configuration

1

Create your Facebook app

  1. Go to My Apps in Meta for Developers and click Create App.

  2. Select None as the app type.

  3. Enter your app name and contact email.

Step 1
Step 2
Step 3
2

Configure your platform(s)

  1. In your app, go to Settings > Basic.

  2. Scroll down and click Add platform.

  3. Select Android or iOS, and click Next.

Step 1
Step 2-3

Natively supports Google Play. Other Android app stores may work but are unsupported.

  1. In Add platform, select Google Play from the list of stores.

  2. Generate your Key Hash:

    1. Go to your Google Play Console, open your app's page, and navigate to Protected With Play > Play Store protection > Protect app signing key > Manage Play App Signing.

    2. Copy the SHA-1 certificate fingerprint under Upload key certificate.

    3. Paste your SHA-1 value and click Convert Hex to Base64.

    4. Copy the resulting Base64 value.

    5. Repeat for the App signing key certificate SHA-1 fingerprint.

  3. Paste both Base64 values into the Key hashes field.

  4. Enter your Package Name - found in the Natively Dashboard under Publish > Android Build > Bundle Identifier.

  5. Enter your Class Name: {YOUR_ANDROID_APP_BUNDLE_ID}.MainActivity - e.g. com.example.natively.MainActivity

  6. Click Save changes.

  7. Go to Settings > Advanced, and copy your Client Token and App ID.

Step 1
Step 2.a
Step 2.b, 2.f
Step 2.c-2.e
Step 3
Step 4-5
Step 6-7
  1. Enter your Bundle ID - found in the Natively Dashboard under Publish > iOS Build > Bundle Identifier.

  2. Enter your iPhone/iPad Store ID - found in the Natively Dashboard under Publish > iOS Build > App Store App ID. This value is the same for iPhone and iPad (if iPad Support is enabled).

  3. Click Save changes.

  4. Go to Settings > Advanced, and copy your Client Token and App ID.

Step 1-3
Step 4

Natively Dashboard Setup

  1. Open your Natively app dashboard and navigate to Features > Analytics > Facebook.

  2. Toggle the feature to Enabled.

  3. Enter the App ID and Client Token you copied from Facebook.

  4. (iOS only) Enter the Permission Description.

  5. Click Save.

  6. Rebuild your app(s).

The Permission Description is the text shown to iOS users when the OS asks them to grant tracking permission (App Tracking Transparency). This field only applies to iOS. Explain clearly why your app needs this permission - for example: "We use your data to provide personalized advertisements that are relevant to your interests".

Implementation

Natively doesn't expose a dedicated Facebook-specific method - standard events (app installs, sessions, and purchases) are logged automatically once configured, with no additional call required.

For any event beyond the automatic ones - such as registration_completed or viewed_product - send it yourself using Custom Event. These events cannot be configured entirely within the Facebook Events Manager; the dashboard can map, report, and optimize on events, but your app must actually send each event at the moment the action happens.

πŸ•΅οΈCustom Event

How to use

Standard events are logged automatically; no setup needed

Once configured, app installs, sessions, and in-app purchases are tracked without any additional call.

Use Custom Event for everything beyond standard events

For engagement, feature usage, or funnel tracking, use Custom Event - it's forwarded to Facebook automatically once configured.

Stick to Facebook's event name limit

Facebook allows up to 1,000 distinct event names per app - reuse a small, consistent set of event names rather than generating dynamic ones per event.

Verify your integration before launching campaigns

Use Facebook's Test Events tool (see Testing on the Custom Event page) to confirm events are actually reaching Facebook before you spend budget attributing campaigns to it.

Troubleshooting

Standard events aren't showing up on Facebook

Go through this checklist:

  • Confirm the feature is enabled and both the App ID and Client Token are entered correctly in the Natively Dashboard.

  • Confirm the app has been rebuilt.

  • Confirm you've allowed enough time for data to propagate.

iOS setup fails, or the app isn't recognized

Confirm your Bundle ID and iPhone/iPad Store ID exactly match what's configured in the Natively Dashboard.

Android setup fails, or the app isn't recognized

Confirm both Key Hash values (Upload key and App signing key) were correctly converted from SHA-1 to Base64, and that your Package Name and Class Name exactly match your app's configuration.

Not working in a web browser or the Natively Preview app

This is a native feature and does not work in a standard web browser or in the Natively Preview app. Test on a real device using a full Natively build.

Last updated