If you want to associate events with the user's name in the activity feed, you'll want to use $first_name
and $last_name
(including the dollar sign) as properties. The Android library doesn't support name tagging in the streams report directly, but you can have a name there too by adding an mp_name_tag
super property to your events. So you might want to have your code look something like this:
MixpanelAPI mixpanel = MixpanelAPI.getInstance(this, MIXPANEL_TOKEN);
MixpanelAPI.People people = mixpanel.getPeople();
// Using the same id for events and people updates will let you
// see events in the people analytics activity feed.
mixpanel.identify("666");
people.identify("666");
// Add the dollar sign to the name properties
people.set("$first_name", "john");
people.set("$last_name", "smith");
JSONObject nameTag = new JSONObject();
try {
// Set an "mp_name_tag" super property
// for Streams if you find it useful.
nameTag.put("mp_name_tag", "john smith");
mixpanel.registerSuperProperties(nameTag);
} catch(JSONException e) {
e.printStackTrace();
}
JSONObject props = new JSONObject();
try {
props.put("Gender", "Male");
props.put("Plan", "Premium");
} catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
mixpanel.track("Plan selected", props);
mixpanel.flush();