Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear distinct_id in mixpanel android when user logs out?

I need Mixpanel to forget distinct_id when user logs out. In iOS app i call reset (https://mixpanel.com/site_media/doctyl/uploads/iPhone-spec/Classes/Mixpanel/index.html#//apple_ref/occ/instm/Mixpanel/reset) and it works.

I cant find the right call in Android mixpanel documentation, i tried calling clearSuperProperties(), but distinct_id persists.

like image 493
DixieFlatline Avatar asked May 22 '14 09:05

DixieFlatline


People also ask

What is alias in mixpanel?

An alias is a new. value that will be interpreted by Mixpanel as an existing value. That. means that you can send messages to Mixpanel using the new value, and. Mixpanel will continue to use the old value for calculating funnels and.

What is mixpanel in Android?

Mixpanel is the most advanced analytics platform which is used to track user interaction with the web and mobile apps.


2 Answers

  1. Call .clearSuperProperties() to remove any Super Properties in local storage.
  2. Set new_distinct_id = UUID.randomUUID().toString());
  3. Call .identify(new_distinct_id) and .getPeople().identify(new_distinct_id)

This should wipe the device clean for a fresh user that can then register and be aliased to another distinct_id.

EDIT: The best way to do this with javascript is to delete the cookie. The name of the cookie is mp_{mixpanel_token_id}_mixpanel :)

like image 98
Jeppe Mariager-Lam Avatar answered Oct 21 '22 17:10

Jeppe Mariager-Lam


Actually there's a reset() function in the MixpanelAPI class that, according to the doc, does the following : "Clears all distinct_ids, superProperties, and push registrations from persistent storage." Hope that helps

like image 24
PeySoul Avatar answered Oct 21 '22 15:10

PeySoul