Classes
Methods
append(name, value)
Appends a value to a list-valued property. If the property does not currently exist,
it will be created as a list of one element. If the property does exist and doesn't
currently have a list value, the append will be ignored.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the People Analytics property that should have it's value appended to |
value |
object | the new value that will appear at the end of the property's list |
clearCharges()
Permanently clear the whole transaction history for the identified people profile.
deleteUser()
Permanently deletes the identified user's record from People Analytics.
Calling deleteUser deletes an entire record completely. Any future calls to People Analytics using the same distinct id will create and store new values.
increment(prop, by)
Add the given amount to an existing property on the identified user. If the user does not already
have the associated property, the amount will be added to zero. To reduce a property,
provide a negative number for the value.
Parameters:
Name | Type | Description |
---|---|---|
prop |
string | the People Analytics property that should have its value changed |
by |
number | the amount to be added to the current value of the named property |
remove(name, value)
Remove value from a list-valued property only if they are already present in the list.
If the property does not currently exist, the remove will be ignored.
If the property exists and is not list-valued, the remove will be ignored.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the People Analytics property that should have it's value removed from |
value |
object | the value that will be removed from the property's list |
set(prop, to)
Sets a single property with the given name and value for this user.
The given name and value will be assigned to the user in Mixpanel People Analytics,
possibly overwriting an existing property with the same name.
Parameters:
Name | Type | Description |
---|---|---|
prop |
string | The name of the Mixpanel property. This must be a String, for example "Zip Code" |
to |
object | The value of the Mixpanel property. For "Zip Code", this value might be the String "90210" |
setOnce(prop, to)
Works just like set(), except it will not overwrite existing property values. This is useful for properties like "First login date".
Parameters:
Name | Type | Description |
---|---|---|
prop |
string | The name of the Mixpanel property. This must be a String, for example "Zip Code" |
to |
object | The value of the Mixpanel property. For "Zip Code", this value might be the String "90210" |
trackCharge(charge, properties)
Track a revenue transaction for the identified people profile.
Parameters:
Name | Type | Description |
---|---|---|
charge |
number | the amount of money exchanged. Positive amounts represent purchases or income from the customer, negative amounts represent refunds or payments to the customer. |
properties |
object | an optional collection of properties to associate with this transaction. |
union(name, value)
Adds values to a list-valued property only if they are not already present in the list.
If the property does not currently exist, it will be created with the given list as it's value.
If the property exists and is not list-valued, the union will be ignored.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | name of the list-valued property to set or modify |
value |
array | an array of values to add to the property value if not already present |
unset(name)
permanently removes the property with the given name from the user's profile
Parameters:
Name | Type | Description |
---|---|---|
name |
string | name of a property to unset |