Facebook Ads
With the Facebook Ads integration, you can easily check your app stats in Meta Analytics. Adapty sends events to Meta Ads Manager, helping you make similar audiences based on subscriptions to get better returns. This way, you can accurately see how much money your ads are making from subscriptions.
The integration between Adapty and Facebook Ads operates in the following way: Adapty sends all subscription events that are configured in your integration to Facebook Ads. This integration is beneficial for evaluating the effectiveness of your advertising campaigns.
Set up integration
Connect Adapty to Facebook Ads
To integrate Facebook Ads and analyze your app metrics, you can set up the integration with Meta Analytics. By sending events to Meta Ads Manager, you can create lookalike audiences based on subscription events like renewals. To configure this integration, navigate to Integrations > Facebook Ads in the Adapty Dashboard and provide the required credentials.
Please consider that the Facebook Ads integration works on iOS 14.5+ only for users with ATT consent.
- To find App ID, open your app page in App Store Connect, go to the App Information page in General section, and find Apple ID in the left bottom part of the screen.
- You need an application on Meta for Developers platform. Log in to your app and then find advanced settings. You can find the App ID in the header.
-
Disable client-side tracking in your Meta SDK configuration to prevent double counting of revenue in Meta Ads Manager. You can find this setting in your Meta Developer Console under App Settings > Advanced Settings. Set Log in-app events automatically to “No”. This will ensure that revenue events are only tracked through Adapty’s integration.
To track install and usage events, you’ll need to activate Meta SDK in your code. You can find implementation details in the Meta SDK documentation for your platform:
You can use this integration with Android apps as well. If you set up Android SDK configuration in the App Settings, setting up the Facebook App ID is enough.
Configure events and tags
Adapty maps its purchase events to Meta’s standard events, which Meta can optimize campaigns on: StartTrial, Subscribe, and fb_mobile_purchase, Meta’s purchase event. Subscription started, Subscription renewed, Trial started, and Trial converted each send one Meta event for every name selected in the event’s field, and all names are selected by default. A trial start, for example, reaches Meta as three events. To send fewer, remove names from the field.
| Adapty event | Default Meta events |
|---|---|
| Subscription started | Subscribe, fb_mobile_purchase |
| Subscription renewed | Subscribe, fb_mobile_purchase |
| Trial started | StartTrial, Subscribe, fb_mobile_purchase |
| Trial converted | Subscribe, fb_mobile_purchase |
| Non-subscription purchase | fb_mobile_purchase |
Meta has no standard event for the remaining events, so Adapty sends them as custom events under their Adapty names. To match your own naming, change the name in the event’s field.
| Adapty event | Default Meta event |
|---|---|
| Subscription expired (Churned) | subscription_expired |
| Subscription renewal cancelled | subscription_renewal_cancelled |
| Subscription renewal reactivated | subscription_renewal_reactivated |
| Subscription paused (Android only) | subscription_paused |
| Subscription deferred (Android only) | subscription_deferred |
| Subscription refunded | subscription_refunded |
| Trial expired | trial_expired |
| Trial renewal cancelled | trial_renewal_cancelled |
| Trial renewal reactivated | trial_renewal_reactivated |
| Entered grace period | entered_grace_period |
| Billing issue detected | billing_issue_detected |
| Non-subscription purchase refunded | non_subscription_purchase_refunded |
| Trial still active | trial_active |
| Subscription still active | subscription_active |
Trial still active and Subscription still active are synthetic events: Adapty sends them to Meta on a timer, and only if the trial or subscription is still running when the timer expires. They carry no revenue, so Meta doesn’t count them toward purchase value. Both are off by default. To send them, turn them on and set the delay.
Connect your app to Facebook Ads
If you follow the steps above, Facebook will automatically receive subscription data from Adapty.
Following the changes to IDFA in iOS 14.5, we recommend that you request the user’s facebookAnonymousId from Facebook. That way, if the user’s IDFA is unavailable, the integration will continue to function. Follow the set user attributes guide iOS, Android, React Native, Flutter, and Unity to set this parameter.
Event structure
Adapty sends events to Facebook Ads (Meta) via the Graph API. Each event is structured like this:
{
"event": "CUSTOM_APP_EVENTS",
"app_user_id": "user_12345",
"advertiser_id": "00000000-0000-0000-0000-000000000000",
"advertiser_tracking_enabled": 1,
"application_tracking_enabled": 1,
"custom_events": "[{\"_eventName\":\"Subscribe\",\"_logTime\":1709294400,\"fb_num_items\":1,\"fb_content_type\":\"in_app\",\"fb_content_id\":\"yearly.premium.6999\",\"fb_currency\":\"USD\",\"fb_order_id\":\"GPA.3383...\",\"fb_transaction_id\":\"GPA.3383...\",\"_valueToSum\":9.99}]",
"extinfo": "[\"i2\",\"com.example.app\",\"1.0.0\",\"100\",\"17.0.1\",\"iPhone14,3\",\"en_US\",\"GMT+3\",\"\",0,0,0,0,0,0,\"GMT+3\"]",
"anon_id": "facebook_anon_id_123"
}
Where:
| Parameter | Type | Description |
|---|---|---|
event | String | Always “CUSTOM_APP_EVENTS”. |
app_user_id | String | The user’s Customer User ID. |
advertiser_id | String | On iOS, the IDFA, or the IDFV when the IDFA is unavailable. On Android, the Advertising ID. When the profile has no device ID, 00000000-0000-0000-0000-000000000000. |
advertiser_tracking_enabled | Integer | 1 if tracking is enabled (ATT authorized), 0 otherwise. |
application_tracking_enabled | Integer | Always 1. |
custom_events | String | JSON-encoded string of event objects (see below). |
extinfo | String | JSON-encoded string containing app/device info (e.g., version, OS, locale). |
anon_id | String | Facebook Anonymous ID (if available). |
The custom_events parameter is a JSON-encoded array with one object for each Meta event the Adapty event maps to. Only StartTrial, Subscribe, and fb_mobile_purchase carry fb_content_id, fb_content_type, fb_num_items, and fb_transaction_id. Each object contains:
| Parameter | Type | Description |
|---|---|---|
_eventName | String | The Meta Ads event name (e.g., “Subscribe”). |
_logTime | Long | Timestamp of the event in seconds. |
_valueToSum | Float | Revenue amount. |
fb_content_id | String | The Product ID from the store. |
fb_currency | String | Currency code (e.g., “USD”). |
fb_order_id | String | Original transaction ID. |
fb_transaction_id | String | Original transaction ID. |
fb_content_type | String | Always “in_app”. |
fb_num_items | Integer | Always 1 for purchase events. |
Troubleshooting
access_level_updated shows as failed in the Event Feed
access_level_updated is a webhook-only event. Adapty never sends it to this integration. But Adapty records an outcome for every enabled integration, and an unsupported event is displayed as a failure.