Skip to main content
Answer

Proper Facebook Ads Integration

  • August 20, 2021
  • 1 reply
  • 492 views

Forum|alt.badge.img+3

Hello, 

I don’t have any conversion on facebook ads, even though the IDFA are sent to Facebook on Revenue Cat and the traffic only comes from Facebook ads.  

I have read the docs but could not find a proper full example. 

Here is what I have done (swift).

I have tested where to call FBSDKCoreKit.AppEvents.activateApp() (before or after ATT request)
 

Option 1:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {


FBSDKCoreKit.Settings.isAutoLogAppEventsEnabled = false
FBSDKCoreKit.AppEvents.activateApp()

Purchases.automaticAppleSearchAdsAttributionCollection = true
Purchases.configure(withAPIKey: "XXXXXXXX")
Purchases.shared.collectDeviceIdentifiers()
Purchases.shared.setFBAnonymousID(FBSDKCoreKit.AppEvents.anonymousID)

if #available(iOS 14.5, *) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
Purchases.shared.collectDeviceIdentifiers()
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(true)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = true
default:
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(false)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = false
}
}

} else {
Purchases.shared.collectDeviceIdentifiers()
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(true)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = true;
}
}
}

 

Option 2:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

FBSDKCoreKit.Settings.isAutoLogAppEventsEnabled = false
Purchases.automaticAppleSearchAdsAttributionCollection = true
Purchases.configure(withAPIKey: "XXXXXXXX")
Purchases.shared.collectDeviceIdentifiers()
Purchases.shared.setFBAnonymousID(FBSDKCoreKit.AppEvents.anonymousID)

if #available(iOS 14.5, *) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
Purchases.shared.collectDeviceIdentifiers()
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(true)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = true;
DispatchQueue.main.async {
FBSDKCoreKit.AppEvents.activateApp()
}
default:
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(false)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = false;
DispatchQueue.main.async {
FBSDKCoreKit.AppEvents.activateApp()
}
}
}

} else {
Purchases.shared.collectDeviceIdentifiers()
FBSDKCoreKit.Settings.setAdvertiserTrackingEnabled(true)
FBSDKCoreKit.Settings.isAdvertiserIDCollectionEnabled = true;
FBSDKCoreKit.AppEvents.activateApp()
}
}
}

 

In either case I have some IDFA collected and sent to Facebook but I cannot see any conversion events. 

 

Thanks for your help, 

 

Best answer by tina

Hey @ev_!

Are you still facing issues with this? It sounds like you have trial starts and trial conversions mapped to the same Facebook Event type. RevenueCat documentation for reference. 

This post has been closed for comments

1 reply

tina
RevenueCat Staff
Forum|alt.badge.img+10
  • RevenueCat Staff
  • Answer
  • September 8, 2021

Hey @ev_!

Are you still facing issues with this? It sounds like you have trial starts and trial conversions mapped to the same Facebook Event type. RevenueCat documentation for reference.