Branch.io (Android SDK): 'only initialize Branch in the Launcher activity' and GDPR

前端 未结 2 698
后悔当初
后悔当初 2021-01-25 21:51

According to the doc: https://docs.branch.io/pages/apps/android/ :

\"Only initialize Branch in the Launcher activity The app will open through the Launcher activity,

相关标签:
2条回答
  • 2021-01-25 22:08

    From the same document that you linked above:

    Enable / Disable User Tracking

    If you need to comply with a user's request to not be tracked for GDPR purposes, or otherwise determine that a user should not be tracked, utilize this field to prevent Branch from sending network requests. This setting can also be enabled across all users for a particular link, or across your Branch links.

    Branch.getInstance().disableTracking(true);

    You can choose to call this throughout the lifecycle of the app. Once called, network requests will not be sent from the SDKs. Link generation will continue to work, but will not contain identifying information about the user. In addition, deep linking will continue to work, but will not track analytics for the user.

    This should allow you to focus on the deep linking functionality without having to worry about user tracking, as you can add separate logic for disabling it. Also, Branch doesn't collect any PII (personally identifiable information) just because of you integrating the SDK. You would have to manually set user IDs and report user events through the Branch.io SDK.

    Branch asks for the SDK to be initialized within the Launcher activity for a few different reasons:

    • App Links - when using App Links (native Android deep linking, supported on Android 6+), the deep link data is found within the intent that started the Launcher activity. In this scenario, unless you handle the intent manually, the data would no longer be accessible if you start another activity without initializing the Branch SDK first.
    • Branch analytics attribution - the intent that started the Launcher activity might contain data that indicates where the app was launched from (could be a push notification, Play Store listing, etc.)

    If you are not using App Links, you can safely initialize the SDK in the MainActivity. Also, since you are not initializing it within the Launcher activity, it's probably a good idea to do it within the onCreate method of MainActivity, instead of onStart. This means you would only consume network data when the MainActivity is loaded the first time - backgrounding and foregrounding the app would not trigger it again. All of the deep links would trigger the Launcher activity anyway, which in turn would open MainActivity, at which point the SDK would be initialized from onCreate.

    0 讨论(0)
  • 2021-01-25 22:12

    Jackie from Branch here.

    As a rule of thumb, initializing the Branch SDK in the Launcher Activity is critical for attribution and is a mandatory step. Without this, the Branch SDK will not be able to report installs, opens or any other down the funnel events and hence you will not get any attribution data on the Branch dashboard.

    That being said, in your case, I'd recommend setting Branch.trackingDisabled = YES at the beginning and then initializing Branch after. When a user opts in for tracking, Branch.trackingDisabled = NO will be called, and the Branch SDK will operate as normal. Installs will be missing for this approach unless the user opts in within the first app open.

    If you have additional questions, please email directly at integrations@branch.io.

    0 讨论(0)
提交回复
热议问题