public static interface MixpanelAPI.Group
MixpanelAPI.getGroup(String, Object)
The Group object is used to update properties in a group's Group Analytics record. A typical use case for the Group object might look like this:
public class MainActivity extends Activity {
MixpanelAPI mMixpanel;
public void onCreate(Bundle saved) {
mMixpanel = MixpanelAPI.getInstance(this, "YOUR MIXPANEL API TOKEN");
...
}
public void companyPlanTypeChanged(string company, String newPlan) {
mMixpanel.getGroup("Company", company).set("Plan Type", newPlan);
...
}
public void onDestroy() {
mMixpanel.flush();
super.onDestroy();
}
}
MixpanelAPI| Modifier and Type | Method and Description |
|---|---|
void |
deleteGroup()
Permanently deletes this group's record from Group Analytics.
|
void |
remove(java.lang.String name,
java.lang.Object value)
Remove value from a list-valued property only if it is already present in the list.
|
void |
set(org.json.JSONObject properties)
Set a collection of properties on the identified group all at once.
|
void |
set(java.lang.String propertyName,
java.lang.Object value)
Sets a single property with the given name and value for this group.
|
void |
setMap(java.util.Map<java.lang.String,java.lang.Object> properties)
Set a collection of properties on the identified group all at once.
|
void |
setOnce(org.json.JSONObject properties)
Like
set(String, Object), but will not set properties that already exist on a record. |
void |
setOnce(java.lang.String propertyName,
java.lang.Object value)
Works just like
set(String, Object), except it will not overwrite existing property values. |
void |
setOnceMap(java.util.Map<java.lang.String,java.lang.Object> properties)
Like
set(String, Object), but will not set properties that already exist on a record. |
void |
union(java.lang.String name,
org.json.JSONArray value)
Adds values to a list-valued property only if they are not already present in the list.
|
void |
unset(java.lang.String name)
Permanently removes the property with the given name from the group's profile
|
void set(java.lang.String propertyName,
java.lang.Object value)
propertyName - The name of the Mixpanel property. This must be a String, for example "Zip Code"value - The value of the Mixpanel property. For "Zip Code", this value might be the String "90210"void setMap(java.util.Map<java.lang.String,java.lang.Object> properties)
properties - a Map containing the collection of properties you wish to apply
to the identified group. Each key in the Map will be associated with
a property name, and the value of that key will be assigned to the property.
See also set(org.json.JSONObject)void set(org.json.JSONObject properties)
properties - a JSONObject containing the collection of properties you wish to apply
to the identified group. Each key in the JSONObject will be associated with
a property name, and the value of that key will be assigned to the property.void setOnce(java.lang.String propertyName,
java.lang.Object value)
set(String, Object), except it will not overwrite existing property values. This is useful for properties like "First login date".propertyName - The name of the Mixpanel property. This must be a String, for example "Zip Code"value - The value of the Mixpanel property. For "Zip Code", this value might be the String "90210"void setOnceMap(java.util.Map<java.lang.String,java.lang.Object> properties)
set(String, Object), but will not set properties that already exist on a record.properties - a Map containing the collection of properties you wish to apply
to the identified group. Each key in the Map will be associated with
a property name, and the value of that key will be assigned to the property.
See also setOnce(org.json.JSONObject)void setOnce(org.json.JSONObject properties)
set(String, Object), but will not set properties that already exist on a record.properties - a JSONObject containing the collection of properties you wish to apply
to this group. Each key in the JSONObject will be associated with
a property name, and the value of that key will be assigned to the property.void union(java.lang.String name,
org.json.JSONArray value)
name - name of the list-valued property to set or modifyvalue - an array of values to add to the property value if not already presentvoid remove(java.lang.String name,
java.lang.Object value)
name - the Group Analytics list-valued property that should have a value removedvalue - the value that will be removed from the listvoid unset(java.lang.String name)
name - name of a property to unsetvoid deleteGroup()
Calling deleteGroup deletes an entire record completely. Any future calls to Group Analytics using the same group value will create and store new values.