Facebook app not registering iOS installs

765 Views Asked by At

Recently our marketing team tried to set up Facebook Mobile App Ads but ran into the following issue.

enter image description here

I reviewed our Facebook Apps developer page and noticed that while the Android app was tracking installs, the iOS app had not registered any installs for the past year, even though I know the app is getting a couple of hundred installs per month.

Since we have tried a couple of solutions, including:

  • Updates the iOS Facebook SDK to the latest build
  • Checking the info.plist to make sure that it has all of the correct information and all of the necessary flags are set to true

We have just pushed a TestFlight build with the updated SDK, but still, nothing is being tracked. Has anyone else had similar problems? I have found a few posts suggesting that the app must show the App Tracking Transparency popup, which the user must agree to, though other users have said that this is not required for the Facebook install events.

1

There are 1 best solutions below

0
Jorge Manuel Bello On

Before start, I have to say I am new in iOS development, so expect redundant code or worse...

I faced same issue some time ago, what I did was:

  1. Documentation talks about install Facebook SDK from Cocoapods and by Package Manager, I used first package manager with no result, then switch to cocoapods method, BTW docs also said about add version to your pod, like this Message from Facebook

I used those pods but with no version, so it looks like this

My current pod

  1. Next was adding Facebook's data in info.plist, let's suppose your App ID is 123456789 (you can check in Facebook console) and your client token is 123mytoken456 you info.plist should looks like this (don't forget to open as code)

     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version="1.0">
     <dict>
     <key>CFBundleURLTypes</key>
     <array>
     <dict>
                 <key>CFBundleURLSchemes</key>
                 <array>
                     <string>fb123456789</string>
         </array>
     </dict>
         </array>
         <key>FacebookAppID</key>
         <string>123456789</string>
         <key>FacebookClientToken</key>
         <string>123mytoken456</string>
         <key>FacebookDisplayName</key>
         <string>CHECK_YOUR_APP_NAME</string>
         <key>NSUserTrackingUsageDescription</key>
         <string>Some random message for asking permission</string>
         <key>FacebookAutoLogAppEventsEnabled</key>
         <false/>
         .
         .
         .
    
  2. In your AppDelegate (my target was iOS 11) import two modules:

     import FBSDKCoreKit
     import FBAudienceNetwork
    
  3. Docs tell you to add some code in didFinishLaunchingWithOptions, I added them and also added this two statement:

     FBAdSettings.setAdvertiserTrackingEnabled(true)
     Settings.shared.isAdvertiserTrackingEnabled = true
    
  4. I created a function to add customs tags, it looks like this:

    import FBSDKCoreKit
    import AppTrackingTransparency
    import AdSupport
    import FBAudienceNetwork
    
    func addTag(tag: String) {
        if #available(iOS 14, *) {
             ATTrackingManager.requestTrackingAuthorization { status in
                 switch status {
                 case .authorized:                
                    AppEvents.shared.logEvent(AppEvents.Name.init(rawValue: tagName)) 
                    //Manage all other status
               }
          } else {
               AppEvents.shared.logEvent(AppEvents.Name.init(rawValue: tagName)) 
          }
       }
    
  5. In your Facebook console, register your bundle id, after all this you should see your custom event in about 20 or 30 minutes after event was triggered. And there was no necessity to publish app, just running in Xcode was enough.

Hope this helps