Facebook Ads
With the Facebook Ads integration, you can easily check your app stats on Facebook Analytics. Adapty sends events to Facebook 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.
How to set up Facebook Ads integration
To integrate Facebook Ads and analyze your app metrics, you can set up the integration with Facebook Analytics. By sending events to Facebook 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 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 Facebook Developers platform. Log in to your app and then find advanced settings. You can find the App ID in the header.
Disable in-app events logging in the Facebook SDK to avoid duplications
Open your App Dashboard and navigate to Analytics->Settings. Then set Log In-App Events Automatically to No and click Save Changes.
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.
Events and tags
Please note that the Facebook Ads integration specifically caters to companies using Facebook for ad campaigns and optimizing them based on customer behavior. It supports Facebook's standard events for optimization purposes. Consequently, modifying the event name is not available for the Facebook Ads integration. Adapty effectively maps your customer events to their corresponding Facebook events for accurate analysis.
Adapty event | Facebook Ads event |
---|---|
Subscription initial purchase | Subscribe |
Subscription renewed | Subscribe |
Subscription cancelled | CancelSubscription |
Trial started | StartTrial |
Trial converted | Subscribe |
Trial cancelled | CancelTrial |
Non subscription purchase | fb_mobile_purchase |
Billing issue detected | billing_issue_detected |
Entered grace period | entered_grace_period |
Auto renew off | auto_renew_off |
Auto renew on | auto_renew_on |
Auto renew off subscription | auto_renew_off_subscription |
Auto renew on subscription | auto_renew_on_subscription |
StartTrial, Subscribe, CancelSubscription are standard events.
To enable specific events, simply toggle on the ones you require. In case multiple event names are selected, Adapty will consolidate the data from all the chosen events into a single Adapty event name.
SDK configuration
Because of iOS IDFA changes in iOS 14.5, if you use Facebook integration, make sure you send facebookAnonymousId
to Adapty via .updateProfile()
method. It allows Facebook to handle events if IDFA is not available.
- iOS (Swift)
- Android (Kotlin)
- Flutter (Dart)
- Unity (C#)
- React Native (TS)
import FacebookCore
do {
try await Adapty.setIntegrationIdentifier(
key: "facebook_anonymous_id",
value: AppEvents.shared.anonymousID
)
} catch {
// handle the error
}
val builder = AdaptyProfileParameters.Builder()
.withFacebookAnonymousId(AppEventsLogger.getAnonymousAppDeviceGUID(context))
Adapty.updateProfile(builder.build()) { error ->
if (error == null) {
// successful update
}
}
There is no official SDK for Flutter
anonymousID is not available in the official SDK
https://github.com/facebook/facebook-sdk-for-unity/issues/676
import { adapty } from 'react-native-adapty';
import { AppEventsLogger } from 'react-native-fbsdk-next';
try {
const anonymousId = await AppEventsLogger.getAnonymousID();
await adapty.updateProfile({
facebookAnonymousId: anonymousId,
});
} catch (error) {
// handle `AdaptyError`
}