exponea / exponea-android-sdk

MIT License
17 stars 16 forks source link

How to disable sdk at runtime? #55

Closed ursusursus closed 1 year ago

ursusursus commented 1 year ago

Hi, I'm working on adding explicit tracking consents to an app and would like some clarification as what to do when consent was removed by user.

If the sdk was not yet initialized, I simply don't initialize it and therefore nothing is tracked

However, if the sdk was initialized, as there is no "deinitialize" method, what's everything I need to disable to make the sdk not track anything (without restarting the app process)?

So far I have just Exponea.automaticSessionTracking = false

Anything else?

janwelocampo commented 1 year ago

I am facing the same issue with sdk cannot be edited on runtime. + 1 for this

adam1929 commented 1 year ago

Hi guys. There is not plan to support this feature. Yes automaticSessionTracking is able to use, but it only switches from automatic mode to manual. If you are facing a question for giving a permission to track (from user with dialog) it has to be requested before SDK init. Lot of tracking libs are working so == if you have no permission, you are not able to track anything. Therefore this permission has to be asked as first step in app. Similar as requesting for notifications, etc... If you are facing a question for tracking of push notifications, campaings, inapps, etc.. you should consider to use DSGVO/GDPR feature that is automatically handled by SDK but is configured on FE. Please read https://documentation.bloomreach.com/engagement/docs/configuration-of-tracking-consent or https://github.com/exponea/exponea-android-sdk/blob/develop/Documentation/TRACKING_CONSENT.md

ursusursus commented 1 year ago

Yes we ask for consent as a first step. However, should be able to revoke this later (if the consent was given at the first step). As you noted, same for notifications etc

And as you're not able to restart app process, there is no way to deinit

adam1929 commented 1 year ago

That feature I mentioned is exactly for your case. If you send a Push notification, it has to contains "tracking consent" flag. Please check documentations due to behaviour and flags. For example, you may define a new consent. If you send a Push notification for customer who didn't have that consent, events for push notifications are not tracked (also InApps etc). You may use force-track for Push action URL - this will be tracked for non-consent customer also. And anytime when customer changed his/her decision, you may update this decision in customers profile on Bloomreach app side. Then push notification will be tracked/not-tracked according to this decision. Please if you have some idea of use-case, feel free to share it with us. Thank you.

adam1929 commented 1 year ago

Still, SDK has no option to be reconfigured in runtime. Nor "turned off".