Meta AEM & CAPI Implementation Guide for Mobile Apps

This guide provides a strategic, high-level resource for implementing Meta AEM (Aggregate Event Measurement) and Conversions API (CAPI) for mobile apps and games. It helps you make informed decisions about when and how to integrate these solutions, with links to detailed technical documentation for implementation specifics.
Introduction & Philosophy
Goal of This Guide:
This guide provides a strategic, high-level resource for implementing Meta’s Aggregate Event Measurement (AEM) and Conversions API (CAPI) for mobile apps and games. It helps you make informed decisions about when and how to integrate these solutions, with links to detailed technical documentation for implementation specifics.
Who Is This Guide For:
- Mobile App or Game Developers implementing Meta SDK or MMP SDK and server-side event tracking
- Growth/Performance Marketers optimizing Meta ad campaigns with proper event instrumentation
- Product Managers overseeing mobile measurement and attribution strategy
- Technical Leaders evaluating AEM vs CAPI approaches for their app
- Anyone responsible for sending high-quality conversion data to Meta Ads
Core Principles:
- Send events that drive optimization decisions
- Prioritize event quality over quantity
- Use AEM for attribution, CAPI for precision
- Always deduplicate between client and server
- Think in terms of user journey, not just events
🎯 Quick Decision Framework
Use this visual flowchart to quickly determine which measurement solution is right for your app
💡 Tip: Click the flowchart to open the full interactive version in Canva
📊 How to Use the Flowchart
The decision flowchart above helps you quickly identify whether you need AEM, CAPI, or both based on your specific use case:
- Start with iOS campaigns: If you’re running iOS user acquisition on Meta, AEM is essential
- Consider your monetization: Apps with subscriptions have different needs than apps that are monetized purely via in-app ads.
- Evaluate your data: User email/name collection significantly impacts Event Match Quality (EMQ)
- Assess server-side needs: Renewals, refunds, and cancellations require CAPI
The flowchart guides you through these questions to recommend the optimal setup. Follow the detailed implementation instructions below once you’ve identified your path.
Understanding AEM vs CAPI
What is AEM?
Aggregate Event Measurement is Meta’s solution for iOS app attribution post-ATT. It enables:
- App install attribution without IDFA
- Post-install event optimization
- Campaign performance measurement with near real-time reporting
What is CAPI for Apps?
Server-to-server event sharing that provides:
- Higher event match quality
- Control over event validation (what actually happened)
- Ability to send events when app isn’t open (renewals, refunds)
When to Use What:
| Scenario | Recommended Approach | Why |
|---|---|---|
| iOS installs & early funnel | AEM via MMP | Best attribution method post-ATT |
| Subscription purchases | Hybrid (SDK + CAPI) | SDK for speed, CAPI for validation |
| Renewals/Refunds | CAPI only | App isn’t open when these occur |
| Android installs | MMP postbacks or SDK | No ATT restrictions |
| High-value actions | Hybrid | Redundancy + better match quality |
AEM Benefits:
- App Promotion and Re-Engagement Campaign types supported
- App Installs, App Events and Value Optimization
- Near real-time reporting
- SKAdNetwork can be used as a supplement
- 1-day and 7-day click reporting for campaigns
- Access to Meta Audience Network with optimization
- Breakdown support: age, gender, country, device, platform, placement
📚 AEM Event Eligibility Criteria
CAPI Benefits:
- Higher Event Match Quality (EMQ) scores through better user matching with additional parameters
- Improved signal quality of app events through server-side validation
- Both better user matching and improved signal quality likely enhance Meta UA campaign performance
- Send revenue transaction events only after they’ve been validated in server
- Ability to send events independent of app state
- Control over event timing and accuracy
AEM Implementation Guide
Prerequisites:
Shared Prerequisites (AEM & CAPI):
- Meta Business Manager account with admin access
- App published on App Store
- Facebook App created and live in Meta Business Manager
- Dataset created in Events Manager and linked with Facebook App
AEM-Specific Prerequisites:
- Events sent via either: Facebook SDK, OR MMP (Mobile Measurement Partner)
- If using MMP: AEM configuration enabled in Meta
- If using AppsFlyer specifically: Advanced Data Sharing configured
- AEM Terms accepted: https://developers.facebook.com/advanced_mobile_measurement/terms
Note: Facebook App and Dataset must be created before implementing SDK/MMP, as the App ID is required for event integration.
Implementation Overview:
Step 1: Create Facebook App and Dataset
Before you can send events, you must set up the infrastructure in Meta Business Manager:
- Create Facebook App:
- Navigate to Meta Business Manager → Apps
- Create a new app or select existing app
- Note your App ID (required for SDK/MMP integration)
- Create Dataset:
- Navigate to Events Manager → Data Sources
- Create new App dataset
- Link Dataset to your Facebook App ID
- Generate Access Token (will be needed for CAPI later)
Important: The App ID and Dataset ID are prerequisites for the next steps. You cannot implement SDK/MMP integration without these.
Step 2: Implement SDK or MMP Integration
Now that you have your App ID, integrate event tracking:
Option A: Facebook SDK Integration
- Implement Facebook SDK in your app using your App ID
- Configure SDK to log standard events
- SDK automatically sends events to Meta
📚 Facebook SDK for iOS | Facebook SDK for Android
Option B: MMP Integration (Recommended for Most Apps)
- Integrate your MMP SDK (AppsFlyer, Adjust, Singular, etc.)
- Configure Meta as a partner in your MMP dashboard using your App ID
- Map your in-app events to Meta standard events
- Enable postbacks from all sources to Meta (not just network-attributed traffic)
📚 AppsFlyer Meta Integration | AppsFlyer AEM Guide
Step 3: Verify Events Flowing and Check AEM Eligibility
After implementing SDK/MMP, verify that events are being received by Meta:
- Navigate to Meta Events Manager
- Select your App dataset
- Check the Overview tab to confirm events are being received
- Allow 24-48 hours for events to start flowing consistently
Once events are flowing, Meta automatically determines app eligibility for AEM.
To check AEM eligibility:
- Events Manager → Select your dataset
- Look for AEM eligibility status
- If not yet eligible, check for any errors or warnings about event configuration

And this is how the eligibility results screen look like:

Note on June 2025 Updates: The automatic configuration and removal of the 8-event limit applies to web AEM. For mobile app AEM, verification of eligibility and MMP configuration is still required.
Step 4: Accept AEM Terms and Configure MMP for AEM
Once your app is eligible for AEM:
- Accept AEM Terms (if not already done): https://developers.facebook.com/advanced_mobile_measurement/terms
- Enable AEM in your MMP dashboard:
- The specific steps vary by MMP (AppsFlyer, Adjust, Branch, Singular, Kochava, etc.)
- General requirements: Map events to Meta standard events and toggle AEM setting
- Refer to your MMP’s documentation for specific instructions
Critical Timing: Allow 2-3 days (sometimes up to 7 days) for Meta to revalidate eligibility after making configuration changes.
Important: After your app is eligible, you’ve accepted the terms, and completed MMP configuration, AEM will appear as the default attribution option when creating new campaigns in Meta Ads Manager.
Step 5: MMP-Specific Configuration (If Applicable)
For AppsFlyer Users:
Enable Advanced Data Sharing to send events for all users:
Settings → Integrated Partners → Meta → Advanced Privacy → Advanced Data Sharing: ON
What this does:
- Sends conversion events for ALL users (consented + non-consented)
- Uses probabilistic attribution with 24hr window
- Critical for maximizing your event volume post-ATT
📚 AppsFlyer Advanced Data Sharing
For Other MMPs:
Check your MMP documentation for equivalent privacy and data sharing settings.
Step 6: Event Volume Requirements
Meta AEM event frequency requirements are case-dependent and vary based on campaign type:
- App Install campaigns: Different requirements than AEO campaigns
- App Event Optimization (AEO) campaigns: May require higher event volumes
- Value Optimization: Typically requires minimum event volumes with distinct values (e.g., 100+ events with 10+ unique values for web)
Check Events Manager → Diagnostics for specific eligibility requirements for your app and campaign type.
If event volume is flagged as low:
- Consolidate similar events
- Use higher-funnel events temporarily
- Consider switching optimization goals based on available event volume
- Review Meta’s event eligibility criteria for your specific use case
📚 AEM Event Eligibility Criteria
Step 7: Verify iOS Tracking Parameters
For iOS 14.5 to iOS 16.x, ensure your integration sends:
- ATE (App Tracking Enabled) parameter
- Correct ATT consent status
Note: ATE parameter is not required for iOS 17.0 or newer devices.
Check Events Manager → Diagnostics for “ATE parameter volume out of range” warnings.
Important Considerations for AEM:
Common Issues to Avoid:
- Low event volume (requirements vary by campaign type)
- ATE parameter issues for iOS 14.5 – 16.x
- Advanced Data Sharing disabled (AppsFlyer)
- For other MMPs: Verify equivalent settings for sending all user data
- Different integrations between install events and post-install events: install and post-install events should come from same integration
- Duplicate events between MMP postbacks and server-side events. Use same event ID for deduplication
CAPI Implementation Guide
Prerequisites:
Shared Prerequisites (AEM & CAPI):
- Meta Business Manager account with admin access
- App published on App Store
- Facebook App created and live in Meta Business Manager
- Dataset created in Events Manager and linked with Facebook App
CAPI-Specific Prerequisites:
- Access Token generated with appropriate permissions
- Server infrastructure to send events
Implementation Overview:
Step 1: Dataset Setup
- Events Manager → Data Sources
- Select your App dataset
- Verify it’s linked to your Facebook App ID
- Generate Access Token from Settings → API Access
Step 2: Understand Required Parameters
Every CAPI event must include:
Core Event Parameters (Required):
event_name: Standard or custom event nameevent_time: Unix timestamp when event occurredaction_source: MUST be"app"for app eventsevent_id: Required for deduplication setup (reuse UUID from client)
User Data (At least one parameter required):
Meta requires at least one user data parameter per event. For best Event Match Quality and campaign performance, include as many as possible:
Recommended for iOS S2S events:
client_ip_address: User’s device IP addressmadid: IDFV (iOS) or AAID (Android)
Additional parameters to improve Event Match Quality:
em: Hashed email (SHA256)ph: Hashed phone (SHA256)fn,ln: Hashed first and last namect,st,zp,country: Location datadb: Date of birth (YYYYMMDD)ge: Gender (m/f/n)
Custom Data (For Monetization Events):
value: Monetary amountcurrency: ISO 4217 code (e.g., “USD”)content_ids: Product identifierssubscription_id,billing_period, etc.
App Data (Required):
advertiser_tracking_enabled: ATT consent status (0 or 1)application_tracking_enabled: Legacy LAT status (0 or 1)extinfo: Array of app/device metadata
📚 Complete CAPI Parameters Reference | User Data Parameters
Step 3: Implement Server-Side Event Sending
Use Meta’s official SDKs or direct API calls:
Available SDKs:
- Python Business SDK
- Node.js Business SDK
- PHP Business SDK
- Java Business SDK
📚 CAPI Server Event Implementation
Step 4: Choose Your Event Strategy
Key Events for Subscription Apps:
Standard Events (Use These):
Purchase: Completed transactionSubscribe: First subscription chargeStartTrial: Trial initiatedCompleteRegistration: Account created
Custom Events (For Lifecycle Tracking):
SubscriptionRenewal: Recurring chargesSubscriptionUpgrade/SubscriptionDowngrade: Plan changesCancelSubscription: User cancelsRefund: Payment refundedPaywall_Viewed: Paywall impressions
Step 5: Improve Event Match Quality
Higher EMQ = Better optimization
Priority Actions:
- Strongly recommended: Add
client_ip_address(user’s device IP, not server) - Strongly recommended: Add
madid(IDFV for iOS, AAID for Android) - Hash and send
em(email) - Hash and send
ph(phone)
Hashing Requirements:
- Lowercase all values before hashing
- Trim whitespace
- Use SHA256 algorithm
- Remove special characters from phone numbers
Hybrid Approach (SDK + CAPI)
Why Use Both?
The hybrid approach combines the best of both worlds:
- SDK: Immediate event signals with low latency
- CAPI: Validated, enriched data with better match quality
- Together: Redundancy, deduplication, and optimal performance
The Golden Rule: Event Deduplication
Critical: Use the same event_id for the same real-world occurrence
Implementation Pattern:
Client Side:
- Generate UUID when event occurs (this usually happens automatically by the Facebook SDK or MMP SDK)
- Send event immediately via Facebook SDK or MMP SDK with
event_id - Store
event_idto pass to server
Server Side:
- Retrieve stored
event_idfrom client - Validate the transaction/action
- Send event via CAPI with same
event_id - Meta automatically deduplicates
Common Use Cases:
| Event Type | Client (SDK) | Server (CAPI) | Why Hybrid? |
|---|---|---|---|
| Purchase | ✅ Immediate | ✅ After validation | Speed + validation |
| StartTrial | ✅ Immediate | ✅ After billing confirm | Speed + truth |
| Subscribe | ✅ Speculative | ✅ After store confirms | Redundancy |
| Renewal | ❌ | ✅ Only | App not open |
| Refund | ❌ | ✅ Only | Server-side only |
Deduplication Best Practices:
Must Match Exactly:
event_id: Same UUID formatevent_name: Same casing and spellingvalue: Same rounding (2 decimals)currency: Same format (e.g., “USD”)
Verify Deduplication:
- Events Manager → Data Sources → Dataset
- Check “Deduplicated Events” metric
- Verify that events are being deduplicated properly
Debugging & Validation
A. Events Manager Test Events
Setup:
- Events Manager → Test Events
- Generate Test Code (e.g.,
TEST12345) - Use this code for both SDK and CAPI testing
For SDK Testing:
- Install Facebook app on test device
- Login with same account as Business Manager
- Perform actions in your app
- View events in real-time in Test Events
Note: This also applies when using MMP SDKs without direct Facebook SDK integration.
For CAPI Testing:
Include test_event_code parameter in API calls. Events appear instantly in Test Events dashboard and do not affect production data.
B. Event Match Quality (EMQ) Dashboard
Location: Events Manager → Data Sources → [Dataset] → Event Match Quality
EMQ Score Breakdown:
- 🟢 8.0-10.0: Excellent – Expect best performance
- 🟡 6.0-7.9: Good – Can improve with more parameters
- 🟠 4.0-5.9: Fair – Add hashed email/phone
- 🔴 <4.0: Poor – Missing critical parameters
How to Improve EMQ:
Current Score <6.0:
- ✅ Strongly recommended to add
client_ip_address(required for S2S) - ✅ Strongly recommended to add
madid(IDFV for iOS, AAID for Android) - ✅ Add hashed
em(email) - ✅ Add hashed
ph(phone)
Score 6.0-8.0:
- ✅ Add
fn,ln(first/last name) - ✅ Add
ct,st,zp(city, state, zip) - ✅ Add
country(ISO 2-letter code) - ✅ Add
db(date of birth)
C. Diagnostics Dashboard
Location: Events Manager → Diagnostics → [Dataset]
Common Warnings & Fixes:
| Warning | Cause | Solution |
|---|---|---|
| Low event volume | Requirements vary by campaign | Consolidate events or use higher-funnel events |
| Invalid currency | Non-ISO 4217 code | Use “USD” not “usd” or “dollars” |
| Missing event_id | Not sent from client/server | Implement UUID generation |
| ATE out of range | ATT status not detected | Update MMP SDK version |
| Invalid extinfo | Wrong array format | Follow exact format from docs |
| Event time in future | Server clock skew | Use NTP sync or actual event timestamp |
Common Issues & Solutions
Issue 1: Events Not Appearing in Events Manager
Symptoms:
- SDK fires event, nothing in dashboard
- CAPI returns 200, no event shown
Checklist:
- App ID linked to dataset?
- Access token has correct permissions?
action_source: "app"included in CAPI?- Test Event Code used for testing?
- Facebook app installed and logged in on test device?
Solution: Use Meta’s Graph API Explorer to check dataset linkage.
Issue 2: Duplicate Events (No Deduplication)
Symptoms:
- Event count 2x expected
- Purchase value doubled in reporting
Common Causes:
- Different UUID formats
- event_id not persisted from client to server
- Timestamp drift causing different event_time
- Event name mismatch
Solution:
- Use same UUID library on client and server
- Store event_id in your database when client fires
- Round event_time to nearest second
- Use exact same event names (case-sensitive)
Issue 3: Low Event Match Quality
Symptoms:
- EMQ score <6.0
- Poor campaign performance
- High cost per action
Priority Fixes:
- Strongly recommended: Add
client_ip_address(user’s device IP, not server) - Strongly recommended: Add
madid(IDFV for iOS, AAID for Android) - Hash and send
em(email) - Hash and send
ph(phone)
Hashing Checklist:
- Lowercase before hashing
- Trim whitespace
- Remove special characters from phone
- Use SHA256 algorithm
Issue 4: AEM Events Not Attributed
Symptoms:
- Installs tracked in MMP but not Meta
- Post-install events missing
- “Advanced Data Sharing” warnings
Solutions:
All MMPs:
- Verify event mapping to Meta standard events
- Include revenue in postback settings for Meta
- Turn on data sharing for all sources (not just for installs attributed to Meta)
- Check event volume (requirements vary by campaign type)
- Verify AEM is enabled in Meta
- Confirm dataset linkage
AppsFlyer-Specific:
- Settings → Meta → Advanced Privacy
- Advanced Data Sharing: MUST BE ON
Issue 5: iOS S2S Events Rejected
Symptoms:
- Error: “Missing required parameter: madid”
- CAPI returns 400 error
- Events not eligible for AEM attribution
Solution:
For iOS S2S events to be eligible for AEM attribution, Meta requires both:
client_ip_address: IP of user’s device (not server IP)madid: IDFV (Identifier for Vendor)
Without these identifiers, the event won’t be eligible for AEM attribution by Meta.
Get IDFV from iOS app and pass to server for CAPI payload.
Appendix: Quick Reference
Standard Events for Subscription Apps:
Purchase– Completed transactionSubscribe– First subscription chargeStartTrial– Trial initiatedCompleteRegistration– Account createdAddPaymentInfo– Payment method added
Custom Events for Subscription Apps:
SubscriptionRenewal– Recurring chargeSubscriptionUpgrade– Plan tier increaseSubscriptionDowngrade– Plan tier decreaseCancelSubscription– User cancelsRefund– Payment refundedPaywall_Viewed– Paywall impressionTrialConversion– Trial converts to paid
Required Parameters by Event Type:
| Event | value | currency | event_id | Other |
|---|---|---|---|---|
| Purchase | ✅ | ✅ | ✅ | content_ids |
| Subscribe | ✅ | ✅ | ✅ | subscription_id |
| StartTrial | ✅ | ✅ | ✅ | trial_period |
| Refund | ✅ (negative) | ✅ | ❌ | refund_reason |
| SubscriptionRenewal | ✅ | ✅ | ❌ | renewal_cycle |
Important Links:
- Meta AEM Documentation
- CAPI for Apps Documentation
- CAPI Parameters Reference
- Event Match Quality Guide
- Standard Events Reference
- AEM Terms
Decision Framework Summary
Use AEM when:
- You need iOS install attribution
- You want MMP-based measurement
- You’re optimizing for installs, AEO (App Event Optimization), or VO (Value Optimization)
- You need near real-time reporting and more granular-level reporting
Use CAPI when:
- You need server-side event validation
- You’re tracking events when app isn’t open (renewals, refunds)
- You want maximum Event Match Quality
- You need full control over event data
Use Hybrid (SDK + CAPI) when:
- You’re tracking high-value monetization events
- You need redundancy and optimal performance
- You want both speed (SDK) and validation (CAPI)
- You’re serious about campaign optimization
