Facebook Ads setup guide

At a glance: Learn about integrating Facebook Ads with AppsFlyer.

iOS 14 updates relating to Facebook

AppsFlyer confirms that our MMP integration with Facebook always implements the Advertiser Tracking Enabled flag. Meaning, no action is required of you in AppsFlyer. This information is provided pursuant to the Facebook app guidance iOS 14 checklist dated February 2021.

Related reading: SKAdNetwork interoperability with AppsFlyer. See this article for iOS 14 related campaign matters. 

Facebook Ads setup guide

How long does it take to start attributing your Facebook mobile app ads with AppsFlyer?

If you already have the AppsFlyer SDK integrated in your app, and already have defined your app on Facebook, the answer is less than a minute! 

You don't need to implement Facebook Login or integrate your app with Facebook's SDK for mobile attribution. Just follow the step-by-step setup instructions below.

Facebook App ID

To create the Facebook App ID:

  1. In Facebook, go to your App Dashboard.
  2. Under Apps, click Create New App.
  3. Complete the name for your app, and enter a unique namespace.

To retrieve the Facebook App ID:

  1. In Facebook, open the Monetization Manager dashboard.
  2. Click the Property you want data from.
  3. Go to Placements > Manage Placement.
    The Facebook App ID is the first part of the Placement ID.

AppsFlyer attributes data per App ID. The same Facebook App ID can be used for both your Android and iOS apps. Note that for iOS 14+, Facebook Ads limits ad accounts for one app per account.

Basic Facebook attribution setup

To start attributing Facebook campaigns with AppsFlyer, follow these steps:

  1. To activate the integration with Facebook Ads:
    1. Go to your apps in Facebook for developers.
    2. Select the app.


    3. To copy your app ID, click on it at the top of the screen.


    4. In AppsFlyer, go to Configuration > Integrated Partners.
    5. Select Facebook Ads from the partners list.
    6. In the Integration tab, turn on Activate partner.


      Learn more about partner activation.
    7. Paste your app ID in the Facebook App ID field.
    8. Click Save Integration.
  2. [optional] To configure recommended settings:


    1. To match Facebook Ads' click-through lookback window, set it to 7 days.
      (Note that there are some specific cases where the default is different).
    2. To match Facebook Ads' view-through lookback window, set it to one day.
    3. To attribute users who reinstall the app during the re-attribution window, turn on Reinstall attribution.
      You don't need to enable view-through attribution or configure lookback windows for reinstall attribution, as it takes its configuration from the install attribution settings.
    4. To save the configuration, click Save Integration.

Still not seeing Facebook results on AppsFlyer? Refer to Facebook Ads integration troubleshooting.


Make sure that the app collects either IDFA or GAID. Failing to do so results in Facebook installs being attributed as organic. For further information, refer to the SDK Integrations Guides for either iOS or Android.

Advanced Facebook attribution setup

With basic attribution already set up for Facebook, it's time for some quick advanced attribution setup.


User-level data


Effective October 29th, 2021, only aggregate reporting from Facebook Ads will be available to advertisers. This change applies to all advertisers, operating systems, and MMPs. It relates to the device-level data for all iOS and Android users, regardless of ATT consent status or ads personalization. See the news bulletin for more details.

By default, you are not able to access your user-level data coming from Facebook Ads.

To get user-level data from Facebook Ads and access it in AppsFlyer:

  1. Go to Facebook Ads partner page > Integration tab and click to accept Facebook's Terms of Service.
  2. Log in to your Facebook Ads account.
  3. Select the relevant app.
  4. Click Accept.
    This allows AppsFlyer to collect and enable you access to your Facebook users' raw data.


Effective April 22, 2020, Facebook introduced enhanced data privacy measures to protect people using their services. As such, Facebook no longer provides advertisers with view-through attribution data at the device level. Starting from the effective date, view-through conversions and the associated in-app events are displayed under the restricted media source. The associated attribution fields in user-level sources such as raw data reports, Push API messages, Pull API reports, are not populated. 

Cost, clicks, and impressions data


Enabling the Facebook Cost feature gets you the cost data for your Facebook campaigns, adsets, ads, and channel levels. It also gets you the aggregated clicks and impressions data for them. See the ad network cost integration table for full details on the supported dimensions, metrics, and features. Note: Cost data requires an Xpend subscription. 

To enable the cost API:

  1. Make sure you are logged into the Facebook user account, which is enabled to handle the account's campaigns on Facebook. The user signing in must have permission to run all the campaigns in Facebook Business Manager.
  2. Go to the Cost tab.
  3. Turn on Get Cost, Clicks and Impressions Data.
  4. Click the Facebook Login button.
  5. When prompted, allow AppsFlyer to access your Facebook campaign data.
    Note: In the first data sync after integration, AppsFlyer receives Facebook cost data up to 3 days retroactively. In subsequent syncs, AppsFlyer receives data from the last 3 days. 

Read more about how Facebook defines clicks and views.

To delete a connected Facebook account: In the actions column, hover over an account and click Delete connection.


  • If you are already logged into Facebook, when you click the Facebook Login button, the Facebook window immediately opens and closes. This is regular behavior.
  • If you have several users with permissions to Facebook, the best practice is to perform the Facebook login for all of them, to avoid getting partial data.

Cost data sync status

View your cost API status and the last time AppsFlyer managed to pull matching cost data in either the cost (and ad revenue) integration status dashboard, or in the individual ad network dashboard.

Facebook allows you to sync several accounts for pulling cost data. For each synced account, AppsFlyer shows the status of cost integration and the last time AppsFlyer managed to pull matching cost data.

Learn more about enriching your Facebook information with cost, clicks and impressions data.

In-app events mapping


To map in-app events:

  1. Turn on In-App Event Postbacks.
    When enabling the Facebook in-app events mapping for an app for the first time, all the af_XXX events from the SDK are automatically mapped to Facebook's predefined event list. This automatic mapping saves you time and decreases mapping mistakes significantly.
  2. Fill in the following parameters:
    Parameter Name Description
    SDK Event Name

    The name of the event, as received by AppsFlyer either from the SDK integrated in your app, or from server-to-server events.
    Tip - Don't see the event you want in the list? Make sure to activate the event on a device with a non-organic installation and recheck. You can also type the event name, click Create custom, and map normally. Read more about custom event mapping.

    Partner Event Identifier Select the most suitable predefined Facebook event tag for your event. You can also send Facebook CUSTOM events.
    Sending option

    Select the sending option for the event:

    • This partner only for events coming only from users attributed to Facebook Ads.
    • All media sources, including organic to have your entire user base available to be reported to Facebook Ads.
    Send Revenue
    • No values & no revenue: sends only the event itself without the event value.
    • Values & no revenue: sends all the parameters excluding the revenue value.
    • Values & revenue: sends all the event parameters, including the revenue value (if exists in the event).
  3. To add an SDK event to the list, click Add Event.

Limitations regarding event names:

  • Length limitation of event names: 2-40 characters 
  • The following characters are not allowed:
    • Colon (:)
    • Period (.)
    • Non-Latin (English) character sets: As of January 12, 2020, Facebook rejects Chinese characters. AppsFlyer has not tested other character sets and you should use these only after verifying with Facebook if they support these character sets in postbacks. 
  • Event names are case-sensitive. To avoid discrepancies, make sure you use the correct case in the event names for all media sources and app versions.

Learn more about Facebook Ads in-app event mapping.

Retargeting attribution

AppsFlyer retargeting attribution for Facebook lets advertisers attribute an existing user's engagement with a Facebook ad, and measure the quality of the user, post engagement, using the AppsFlyer reports.

It should be used only if you are actively running campaigns targeted at your own users in Facebook.

  1. Enable re-targeting in app settings page.
  2. On Facebook Ads partner page, turn on Re-engagement attribution.
  3. Set the Re-engagement click-through lookback window.
    The re-engagement lookback window is the period of time, starting from ad click, during which the app must be launched for the click to be recorded as a re-engagement.
    Select a lookback window in hours or days, and set the slider to the desired value.
  4. Set the Re-engagement window.
    This is the period when the user's in-app events are attributed to the retargeting media source, as primary source.
    You can set the value in days (1-90), hours (up to 23), or even lifetime. The default is 30 days.


Learn more about AppsFlyer retargeting attribution.

Learn more about deep linking users from SRNs such as Facebook.

Comply with California consumer privacy act (CCPA)

Complying with CCPA privacy regulations limits the data coming from Facebook users based in California, USA.

To enable compliance with CCPA: Turn on Limit Facebook use of users' personal information (CCPA) in the Integration tab.

Learn more about CCPA compliance.

Ad revenue recording


If your app uses Facebook Audience Network Ad Revenue for ad monetization, you can record your revenues from Facebook on AppsFlyer. This, with or without in-app purchase revenue data, gives you a complete picture of your user revenues.

To start recording Facebook Audience Network Ad Revenue:

  1. On the Ad Revenue tab, set Get Ad Revenue Data to ON.
  2. Select the type of aggregated ad revenue data you want to receive: Attributed revenue and/or Aggregated monetization revenue:
    • Attributed Revenue: Revenue based on the user acquisition source.
      Set the Event Source, which is the event representing your ad revenue model in the best possible way. For example, if your revenue is based on impressions, it is recommended to send AppsFlyer an ad_viewed event. The best event can be configured for each monetization platform separately. However, it is also possible to use the af_app_opened event. In this case, ad revenue is attributed for every app open performed by the user.
    • Aggregated monetization revenue: Revenue based on the ad source.
  3. The Ad Revenue Event is displayed. It is a read-only field presenting the new ad revenue event called [source event]_monetized (for example, Ad_Watched_Monetized as displayed above). The ad revenue event is presented in the dashboard as an additional event.
  4. Click Connect to Facebook to enable collection of Facebook Audience Network Ad Revenue on Facebook. Log in with your Facebook credentials to authorize Facebook Audience Network Ad Revenue.
  5. Enter the Audience Network App ID (Facebook App ID). Get this from Facebook Audience Network (FAN).
    • Get the Facebook App ID.
    • Copy the ID to the Audience Network App ID field in AppsFlyer.
  6. Click Save ad revenue.


If you use MoPub to mediate Facebook, and have a MoPub SDK integration, as well as a direct Facebook integration, AppsFlyer filters out Facebook ad revenue data from Mopub and uses the data from Facebook. 


Enable Facebook Ads to perform various actions and to access your data according to the available permissions.

Learn more about granting permissions to integrated partners.

Was this article helpful?