Search code examples
facebookfacebook-javascript-sdkfacebook-analytics

Facebook Analytics and SDK - Device Info Parameters


Using the Facebook SDK with iOS/Android/JS Facebook Analytics it looks like you can segment by a huge variety of Device Info parameters: Model, OS, Screen Size, Time Zone, etc. My question is, how does this data actually get provided to Facebook Analytics, does the Facebook SDK handle it for you or do you (the developer) need to pass this data as parameters in logevent calls?

Looking at the source for the Android SDK, it looks like the SDK is collecting it and providing it for you:

https://github.com/facebook/facebook-android-sdk/blob/8028cd89c92c61fda1ab826927eecf3c10357fa7/facebook/src/main/java/com/facebook/devicerequests/internal/DeviceRequestsHelper.java


Solution

  • I think I figured it out, incase it helps anyone. The SDK does collect quite a bit of device info, serializes it, and sends it with the appevent calls.

    Device info collection and serialization:

    https://github.com/facebook/facebook-android-sdk/blob/8028cd89c92c61fda1ab826927eecf3c10357fa7/facebook/src/main/java/com/facebook/internal/Utility.java#L700

    Sending the data:

    https://github.com/facebook/facebook-android-sdk/blob/bb430b1dd14143a0a8f4e1bf5f94519f1f95f901/facebook/src/main/java/com/facebook/internal/AppEventsLoggerUtility.java#L68