Solved

Proper Facebook Ads Integration

  • 20 August 2021
  • 1 reply
  • 324 views

Badge +3
  • New Member
  • 0 replies

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, 

 

icon

Best answer by tina 8 September 2021, 22:40

View original

1 reply

Userlevel 5
Badge +10

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. 

Reply