What this does: Connects Meta Ads (Facebook/Instagram) to AppsFlyer to measure app installs, re-engagements, and in-app events from Meta campaigns.
Good news: If you already have the AppsFlyer SDK in your app and your app is on Meta Ads, setup takes less than a minute. You do NOT need Facebook Login or Facebook's SDK.
PART 1 — BASIC SETUP
STEP 1 — CREATE AND RETRIEVE YOUR FACEBOOK APP ID
To CREATE a Facebook App ID:
1. Go to your Meta App Dashboard (developers.facebook.com/apps).
2. Under Apps, click Create New App.
3. Enter a name and unique namespace for your app.
4. Select the correct platform (iOS or Android). Wrong platform = missed attribution.
To RETRIEVE your Facebook App ID:
1. Go to your Meta App Dashboard.
2. Click on your app.
3. Click the App ID at the top left to copy it.
Note: The same Facebook App ID can be used for both Android and iOS apps. For iOS 14+, Meta limits ad accounts to 9 per app.
STEP 2 — ENABLE META ADS DEVICE-LEVEL DATA (Advanced Mobile Measurement)
Re-enabled June 17, 2025. Opting in gives you device-level analytics and full attribution visibility.
1. Visit Meta Ads.
2. Select the relevant App ID(s).
3. Accept Meta's Advanced Mobile Measurement terms. (Must be done by an admin of your Meta developer app.)
Note: Device-level data is only available for new attributed devices after accepting the terms.
STEP 3 — ACTIVATE THE META ADS INTEGRATION IN APPSFLYER
1. In AppsFlyer, go to Collaborate > Partner Marketplace in the side menu.
- To edit an existing integration: Go to Collaborate > Active Integrations instead.
2. Search for Meta ads and select it.
3. Click Set up integration.
4. In the Integration tab, turn on Activate partner. Keep this on while you work with Meta.
5. Under General settings:
- Paste your Facebook App ID in the Facebook App ID field.
- Paste the Install Referrer Decryption Key from Meta Ads (see Step 5).
- Turn Advanced Data Sharing on or off (see Step 9 for details).
6. Click Save Integration.
STEP 4 — CONFIGURE RECOMMENDED SETTINGS (Optional)
- Set the click-through lookback window to 7 days to match Meta's default.
- Set the view-through lookback window to 1 day to match Meta's default.
- Turn on Reinstall attribution to track users who delete and reinstall your app. No extra lookback window needed.
PART 2 — ADVANCED SETUP
STEP 5 — GET THE ANDROID DECRYPTION KEY
To get your decryption key from Meta:
1. Log in to your Meta developer portal.
2. Click My Apps in the upper right corner.
3. Select the relevant app.
4. Go to Settings > Basic in the left-hand menu.
5. Scroll to the Android section.
6. Find and copy the Install Referrer Decryption Key listed under your Package Name field.
To enter the decryption key in AppsFlyer:
1. Make sure your app uses AppsFlyer SDK version 5.4 or later.
2. Go to Collaborate > Active Integrations.
3. Select Meta Ads.
4. In the Integration tab, paste the key into the Install Referrer Decryption Key field.
5. Click Save integration. (Only needed once per app.)
What this unlocks: Raw data reports with match types gp_referrer (Google Play), fb_referrer (Facebook app), or ig_referrer (Instagram app), plus full campaign attribution fields.
STEP 6 — COST, CLICKS, AND IMPRESSIONS (Optional — ROI360 required for cost)
1. Make sure you're logged into the Meta Ads account that manages your campaigns in Meta Business Manager.
2. Go to the Cost tab in AppsFlyer.
3. Turn on Get Cost, Clicks and Impressions Data.
4. Click the Facebook login (f) button and log in with a Meta business or admin account.
5. When prompted, allow AppsFlyer to access your Meta Ads campaign data.
6. Click Save.
Note: AppsFlyer automatically collects up to the last 7 days of cost data on the first sync. You can connect multiple accounts. To remove an account, hover over it in the Actions column and click Delete connection.
STEP 7 — IN-APP EVENT MAPPING (Optional)
1. In the Integration tab, turn on In-app event postbacks.
(When enabled for the first time, af_app_open is automatically mapped to fb_mobile_activate_app.)
2. Click Add event to map your app events to Meta events.
3. For each event, fill in:
- AppsFlyer event: The event name tracked in your app (e.g., "purchase").
- Mapped to partner event: Type the Meta event ID, select from the dropdown, or choose As is to send event name without mapping.
- For users from: This partner only OR All media sources, including organic.
- Data to include: No data (default), Values and revenue, or Values without revenue.
Event name rules:
- Must be 2-40 characters
- No colons (:) or periods (.)
- No Chinese characters (rejected by Meta as of Jan 12, 2020)
- Case-sensitive — use consistent capitalization across all sources
Tip: Map af_ad_revenue to the right Meta event to let Meta optimize campaigns based on your ad revenue.
STEP 8 — RETARGETING ATTRIBUTION (Optional)
Use only if you are actively running campaigns targeted at your existing Facebook users.
1. Turn on Retargeting in AppsFlyer App Settings.
2. On the Meta Ads partner page, turn on Re-engagement attribution.
3. Set the Re-engagement click-through lookback window (hours or days).
4. (Optional) Turn on Re-engagement view-through attribution and set window (up to 24 hours).
5. Set the Re-engagement window — how long a user's in-app events are attributed to Meta after re-engagement. Options: 1-90 days, up to 23 hours, or Lifetime. Default is 30 days.
WhatsApp campaigns: If you run WhatsApp Marketing message campaigns for re-engagement, these are automatically measured when re-engagement is enabled at both integration and app levels. No extra setup needed. Channel field shows "WhatsApp."
STEP 9 — ADVANCED DATA SHARING (Optional)
- Advanced Data Sharing ON: Meta receives postbacks and events with device-level identifiers for ALL devices, even those without an available Advertising ID (IDFA). AppsFlyer also attributes these events.
- Advanced Data Sharing OFF: Only devices with an available IDFA send postbacks. Covers iOS click-through, view-through installs, and deep link re-engagements (max 24-hour attribution window).
Note: If Advanced Data Sharing is ON but attribution is missing, check whether your events meet Meta's eligibility criteria in the Meta documentation.
STEP 10 — CCPA COMPLIANCE (Optional)
To comply with California Consumer Privacy Act regulations:
1. In the Integration tab, turn on Limit Meta ads use of users' personal information (CCPA).
This limits data received from California-based Meta Ads users.
STEP 11 — AD REVENUE RECORDING (Optional)
If your app uses Meta Audience Network for ad monetization:
1. Go to the Ad Revenue tab and turn on Get ad revenue data.
2. Choose the type of ad revenue data:
- Attributed revenue: Revenue tied to the user's acquisition source. Set the Event Source (e.g., ad_viewed for impression-based, or af_app_opened for every app open).
- Aggregated monetization revenue: Revenue tied to the ad source (not user). A read-only Ad Revenue Event field appears (e.g., Ad_Watched_Monetized).
3. Click Connect to Meta Ads.
4. Log in with your Meta Ads credentials.
5. Enter your Audience Network App ID (your Facebook App ID from Meta Audience Network).
6. Click Save ad revenue.
STEP 12 — PERMISSIONS (Optional)
Use the Permissions tab to control what data Meta Ads can access and what actions they can take on your behalf.
TROUBLESHOOTING
No IDFA collection:
For iOS apps, add the AdSupport.framework to your project. Starting iOS 14.5, display the Apple ATT prompt and get user consent. Check your Installation Raw Data report if the IDFA column is empty.
Wrong Facebook App ID:
Verify the App ID in AppsFlyer matches exactly what's in your Meta Ads dashboard. Validate using Facebook's Graph API if needed.
App status on Meta Ads:
Your app must be set to Live (not "In Development") on Meta Ads for attribution to work.
Wrong campaign type:
Make sure the campaign is set to Mobile app install ads or Mobile App Engagement. For other objectives, check the App Event recording option when setting up the campaign.
AEM attribution not working:
If Advanced Data Sharing is ON and attribution is still missing, check whether your events meet Meta's eligibility criteria in the Meta documentation.
Incorrect app setup in Meta Ads campaign:
Always select your app from the dropdown list when setting up a Meta App Install campaign. Do NOT paste the store URL — this breaks AppsFlyer attribution.
iOS 14 note:
No action needed in AppsFlyer for iOS 14 compliance. The Advertiser Tracking Enabled flag is handled automatically. Make sure the iOS 14 Campaign toggle is enabled on Meta Ads when setting up iOS 14 campaigns.
Important reminder: You do NOT need to implement Facebook Login or integrate the Facebook SDK into your app for mobile attribution to work with AppsFlyer.