Question

Proper Facebook Ads Integration

  • 20 August 2021
  • 1 reply
  • 52 views

Badge
  • 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, 

 


1 reply

Userlevel 3
Badge +8

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