Methods
addGroup(groupKey, groupID)
Add a group to this user's membership for a particular group key
Parameters:
| Name |
Type |
Description |
groupKey |
|
The property name associated with this group type (must already have been set up). |
groupID |
|
The new group the user belongs to. |
- Source:
alias(alias, distinctId)
The alias method creates an alias which Mixpanel will use to remap one id to another.
Multiple aliases can point to the same identifier.
`mixpane.alias("New ID", mixpane.distinctId)`
`mixpane.alias("Newer ID", mixpane.distinctId)`
This call does not identify the user after. You must still call both identify() and
People.identify() if you wish the new alias to be used for Events and People.
Parameters:
| Name |
Type |
Description |
alias |
|
A unique identifier that you want to use as an identifier for this user. |
distinctId |
|
the current distinct_id that alias will be mapped to. |
- Source:
clearSuperProperties()
Clear all currently set super properties.
- Source:
deleteGroup(groupKey, groupID)
Permanently deletes this group's record from Group Analytics.
Parameters:
| Name |
Type |
Description |
groupKey |
|
String identifying the type of group (must be already in use as a group key) |
groupID |
|
Object identifying the specific group
Calling deleteGroup deletes an entire record completely. Any future calls
to Group Analytics using the same group value will create and store new values. |
- Source:
eventElapsedTime()
Retrieve the time elapsed for the named event since timeEvent(eventName) was called.
- Source:
flush()
Upload queued data to the Mixpanel server.
- Source:
getDistinctId()
Returns the string id currently being used to uniquely identify the user associated
with events.
- Source:
getGroup(groupKey, groupID)
Returns a MixpanelGroup object that can be used to set and increment
Group Analytics properties.
Parameters:
| Name |
Type |
Description |
groupKey |
|
String identifying the type of group (must be already in use as a group key) |
groupID |
|
Object identifying the specific group |
- Source:
Returns:
an instance of MixpanelGroup that you can use to update
records in Mixpanel Group Analytics
getPeople()
Returns a Mixpanel People object that can be used to set and increment
People Analytics properties.
- Source:
Returns:
an instance of People that you can use to update
records in Mixpanel People Analytics
getSuperProperties()
Get current user super property.
- Source:
hasOptedOutTracking()
Will return true if the user has opted out from tracking.
- Source:
Returns:
true if user has opted out from tracking. Defaults to false.
identify(distinctId)
Associate all future calls to track() with the user identified by
the given distinct id.
Calls to track() made before corresponding calls to identify
will use an anonymous locally generated distinct id, which means it is best to call identify
early to ensure that your Mixpanel funnels and retention analytics can continue to track the
user throughout their lifetime. We recommend calling identify when the user authenticates.
Once identify is called, the local distinct id persists across restarts of
your application.
Parameters:
| Name |
Type |
Description |
distinctId |
|
a string uniquely identifying this user. Events sent to
Mixpanel using the same disinct_id will be considered associated with the
same visitor/customer for retention and funnel reporting, so be sure that the given
value is globally unique for each individual user you intend to track. |
- Source:
(async) init(token, optOutTrackingDefault)
Initializes an instance of the API with the given project token.
Parameters:
| Name |
Type |
Description |
token |
|
your project token. |
optOutTrackingDefault |
|
Optional Whether or not Mixpanel can start tracking by default. See
optOutTracking() |
- Source:
optInTracking()
Use this method to opt-in an already opted-out user from tracking. People updates and track
calls will be sent to Mixpanel after using this method.
This method will internally track an opt-in event to your project.
- Source:
optOutTracking()
Use this method to opt-out a user from tracking. Events and people updates that haven't been
flushed yet will be deleted. Use flush() before calling this method if you want
to send all the queues to Mixpanel before.
This method will also remove any user-related information from the device.
- Source:
registerSuperProperties()
Register a set of super properties, which are included with all
events. This will overwrite previous super property values.
- Source:
registerSuperPropertiesOnce()
Register a set of super properties only once. This will not
overwrite previous super property values, unlike register().
- Source:
removeGroup(groupKey, groupID)
Remove a group from this user's membership for a particular group key
Parameters:
| Name |
Type |
Description |
groupKey |
|
The property name associated with this group type (must already have been set up). |
groupID |
|
The group value to remove. |
- Source:
reset()
Clear super properties and generates a new random distinctId for this instance.
Useful for clearing data when a user logs out.
- Source:
setGroup(groupKey, groupID)
Set the group this user belongs to.
Parameters:
| Name |
Type |
Description |
groupKey |
|
The property name associated with this group type (must already have been set up). |
groupID |
|
The group the user belongs to. |
- Source:
timeEvent()
Use to calculate time required for an event by including the time between this call and a
later 'track' call for the same event in the properties sent
with the event.
- Source:
track(eventName, properties)
Track an event.
Every call to track eventually results in a data point sent to Mixpanel. These data points
are what are measured, counted, and broken down to create your Mixpanel reports. Events
have a string name, and an optional set of name/value pairs that describe the properties of
that event.
Parameters:
| Name |
Type |
Description |
eventName |
|
The name of the event to send |
properties |
|
A Map containing the key value pairs of the properties to include in this event.
Pass null if no extra properties exist. |
- Source:
trackWithGroups(eventName, properties, groups)
Track an event with specific groups.
Every call to track eventually results in a data point sent to Mixpanel. These data points
are what are measured, counted, and broken down to create your Mixpanel reports. Events
have a string name, and an optional set of name/value pairs that describe the properties of
that event. Group key/value pairs are upserted into the property map before tracking.
Parameters:
| Name |
Type |
Description |
eventName |
|
The name of the event to send |
properties |
|
A Map containing the key value pairs of the properties to include in this event.
Pass null if no extra properties exist. |
groups |
|
A Map containing the group key value pairs for this event.
See also org.json.JSONObject), Map) |
- Source:
unregisterSuperProperty()
Delete a super property stored with the current user.
- Source: