Adapty Developer Hub

Welcome to the AdaptyTeam developer hub. You'll find comprehensive guides and documentation to help you start working with Adapty as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Discussions

Facebook Ads

Learn how to set up integration with Facebook Ads

To integrate Facebook Ads go to Integrations > Facebook Ads and set credentials.

Facebook Ads integration is different from all others. Usually, companies create ads using Facebook and would like to optimize campaigns based on customer's behavior. Optimization is available only for Facebook standard events. That's why editing event name is not available for Facebook Ads integration. Adapty properly maps customers event into Facebook events in the following way

Adapty eventFacebook Ads event
Subscription initial purchaseSubscribe
Subscription renewedSubscribe
Subscription cancelledCancelSubscription
Trial startedStartTrial
Trial convertedSubscribe
Trial cancelledCancelTrial
Non subscription purchasefb_mobile_purchase
Billing issue detectedbilling_issue_detected
Entered grace periodentered_grace_period
Auto renew offauto_renew_off
Auto renew onauto_renew_on
Auto renew off subscriptionauto_renew_off_subscription
Auto renew on subscriptionauto_renew_on_subscription

StartTrial, Subscribe, CancelSubscription are standard events.

You need an application on Facebook Developers platform. Log in to your app and then find advanced settings.

Scroll down and find a Client Token. Also, find the App ID in the header.

App ID and Client TokenApp ID and Client Token

🚧

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.

Disable in-app events logging in the Facebook SDK to avoid duplications

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.

let params = ProfileParameterBuilder().withFacebookAnonymousId(FBSDKCoreKit.AppEvents.anonymousID)
Adapty.updateProfile(params: params) { (error) in    
    if error == nil {        
        // successful update                                  
    }
}

Updated about 9 hours ago


Facebook Ads


Learn how to set up integration with Facebook Ads

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.