I agree with the approach of not manually setting the user's push subscription status to "unsubscribed" when they log out. That path introduces a lot of complexity, especially for users with multiple devices.
To address your specific questions about the best practice for logged-out users:
Using the SDK's function to stop tracking on logout is a recommended method. It directly addresses your GDPR/privacy concerns by ensuring no user activity is tracked while they are logged out.
Regarding your other points:
- De-registering Push Tokens: I would advise against this. There's no need to deregister the tokens. You can keep them tracked in Braze, stored on the user's profile. It simplifies the process significantly when they log back in.
- Anonymous Users: The anonymous user/merge flow is overly complex for this use case and, as you noted, can be tricky when an external_id is already present. A simpler solution is much more effective.
The most straightforward and robust way to manage this is with a simple custom attribute.
Here’s the recommended flow:
- Set a Custom Attribute: Create a boolean attribute like is_logged_in.
- On User Logout: Set is_logged_in to false and then call the functions to stop tracking.
- On User Login: Re-enable the SDK, call changeUser() to identify the user, and set is_logged_in to true.
By doing this, you can easily filter all your push campaigns and Canvases to only send to users where is_logged_in is true.
This approach cleanly solves both of your main requirements:
- No pushes are sent to logged-out users because of the segment filter.
- Push preferences are instantly recovered upon re-login because their subscription state was never altered.
Hope this helps clear things up,
Emmett, Covalent Marketing