SDK Setup and Adding App Events

When you first complete app setup, you can only optimize delivery of your ads for LINK_CLICK or clicks on the actual ad. For best results, we recommend that you add more events so you can also optimize your ad for installs or other actions such as purchases or D2 or D7 retention (opening the app again two or seven days after installing).

If you're working with a Facebook Mobile Measurement Partner, your partner can set up your app, SDKs, and App Events for you.

If you will be doing the setup and adding app events yourself, you can use this page to find out how. The basic steps are:

  1. Set up a Facebook SDK. For mobile apps, set up the iOS SDK or Android SDK (or both). For desktop apps, set up the JavaScript SDK.
  2. Add app events. Use Codeless App Events or add app event code manually.
  3. Resubmit the app to the app store and App Review.

SDK Setup

Facebook SDKs enable you to pass app event data from your app to Facebook. With app event data, you can accurately track and measure the actions people take in your app.

  1. If you have not already done so, specify your app's platform in the app settings. Open the App Dashboard for your app, choose Settings > Basic, and go to the Platform section.

    If you provide your app on multiple platforms, repeat this setup for each platform where your app is available. For example, if your app is available on both Android and iOS, you should set up platforms twice in your app settings - once for the Android SDK and a second time for the iOS SDK.

  2. Download the SDK and follow the instructions:

At this point, the SDK is set up, and your application can pass app install events to Facebook for measurement and tracking purposes. With this data, you can track and measure app installs and also optimize your ads delivery for mobile app installs. Now that you've implemented the SDK for your platform, you should also add code for additional app events you want to track and measure, such as purchases.

For full instructions and documentation on Facebook SDKs, see these guides:

In the next section, we will look at how to track more types of events.

Adding Other App Events

After you verify your SDK is set up correctly, you can add additional app events to your app. By adding more events, you can track or log your app events automatically or when you make specific calls in your app.

For a complete list of the standard app events you can log, see:

You can track and measure these app events in two ways:

  • Use our codeless setup tool in Facebook's Events Manager. This is a simple tool for setting up events without implementing code. You can interact with app screen elements such as buttons, images, or links to define event names. As people navigate through the app and interact with these UI elements, events are sent to Facebook.

For more information, regardless of platform, see App Events API.

In a few cases, you may want to set up custom App Events, which track special events that are unique to your application. For full details, see App Events.

At this point, you can track and measure for any of the app events you implemented. With App Events, you can use APP_INSTALLS, TRAFFIC, and CONVERSIONS as your advertising objectives. You can optimize your ads for people most likely to complete an app event; see App Event Optimization.

With this App Event data, you or your measurement partner could also create custom audiences, and you can target ads to these audiences. See Marketing API, Mobile App Custom Audiences and Ads Help Center, Custom Audience from your Mobile App.

Resubmit Your App

After you add a Facebook SDK and App Events to your app:

  • You must resubmit your app to the app stores where it's available for download. You need to do this because you changed the source code.
  • The app must also pass App Review.