Facebook Analytics - is Facebook SDK required?

  • 20 July 2021
  • 4 replies

Userlevel 2
Badge +6

I’m continuing the discussion from spectrum here:

@ryan your docs don’t make any distinction between iOS and Android when it comes to whether the Facebook SDK should be installed, so I assumed it had to be installed on both platforms. If not, that would be a great thing, as the SDK is huge.

4 replies

Userlevel 6
Badge +8

Hey @sven!

For Android, we only require the $androidId and $gpsAdId attributes to be set to send data into Facebook, which should be collected by the collectDeviceIdentifiers method. Since the Facebook SDK isn’t required to collect these properties, you should be able to leave it out of your Android project.

iOS events require a Facebook anonymous ID to be generated from the Facebook SDK and set as the $fbAnonId subscriber attribute, so you’ll need to install the Facebook SDK for your iOS project.

Of course, you’ll want to test this by setting a Facebook App ID and Client Token in the ‘sandbox’ section of your Facebook integration settings, and following the instructions here.

Userlevel 2
Badge +6

Thanks for the quick reply @cody ! Great news!

Might make sense to update the documentation (step 1) to mention that integration of the SDK isn’t necessary on Android.


Userlevel 5
Badge +9

The difference here is between required and recommended. The RevenueCat <> Facebook integration is done server-to-server, so the Facebook SDK is not required. I’ll try to break down a bit more detail of how the integration works, so you can decide if the Facebook SDK is something you want to include or not.

RevenueCat sends events into Facebook via their App Events REST API. This is done from the RevenueCat server so doesn’t depend on the Facebook SDK directly.

Once the events make it into Facebook, Facebook is trying to tie that event back to a user, and ideally determine if that user was exposed to an ad or not. This is where there could be benefits of including their SDK.

With the Facebook SDK installed, you’re able to pass the $fbAnonId to RevenueCat as @cody mentioned and RevenueCat will send it along to Facebook with the event. The $fbAnonId is used by Facebook to help identify users when the IDFA is not present. If you’re not requesting the IDFA permission on iOS, then it’s probably beneficial to include this. 

Outside of this parameter on iOS, there’s no other data provided by the Facebook SDK that RevenueCat uses directly, however there still could be some additional benefits. The Facebook SDK is a bit of a blackbox, but there is a lot going on under the hood to try and link an install/usage to an ad impression. When RevenueCat sends the event into Facebook, you’d want to give Facebook the best shot at linking that event back to an ad. If your goal is to use Facebook Ads Manager for attribution, my guess is you could be losing a lot of attribution accuracy by removing their SDK. And if you’re spending a good chunk of money on ads that mean you’re probably leaving some dollars on the table if you don’t include the Facebook SDK.

That said, there’s tradeoffs in everything. There are customers out there that don’t want to install apps that use the Facebook SDK or install apps if the file size is too large. You know your customers better, and if you think having a smaller app footprint that’s more privacy focused will lead to more conversions you may come out ahead by dropping the Facebook SDK.

Hope this helps! I’ll see if we can add more of these details into the docs!

Userlevel 2
Badge +6

@ryan Thanks for that great explanation! Now I feel I can make an informed decision regarding the inclusion/removal of the Facebook SDK. :ok_hand: