$_token
$_token : string
Provides an API to create/update profiles on Mixpanel
$_consumer : \ConsumerStrategies_AbstractConsumer
set(string|integer $distinct_id, array $props, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Set properties on a user record. If the profile does not exist, it creates it with these properties.
If it does exist, it sets the properties to these values, overwriting existing values.
string|integer | $distinct_id | the distinct_id or alias of a user |
array | $props | associative array of properties to set on the profile |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
setOnce(string|integer $distinct_id, array $props, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Set properties on a user record. If the profile does not exist, it creates it with these properties.
If it does exist, it sets the properties to these values but WILL NOT overwrite existing values.
string|integer | $distinct_id | the distinct_id or alias of a user |
array | $props | associative array of properties to set on the profile |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
remove(string|integer $distinct_id, array $props, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Unset properties on a user record. If the profile does not exist, it creates it with no properties.
If it does exist, it unsets these properties. NOTE: In other libraries we use 'unset' which is a reserved word in PHP.
string|integer | $distinct_id | the distinct_id or alias of a user |
array | $props | associative array of properties to unset on the profile |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
increment(string|integer $distinct_id, $prop, integer $val, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Increments the value of a property on a user record. If the profile does not exist, it creates it and sets the property to the increment value.
string|integer | $distinct_id | the distinct_id or alias of a user |
$prop | string the property to increment |
|
integer | $val | the amount to increment the property by |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
append(string|integer $distinct_id, string $prop, string|array $val, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Adds $val to a list located at $prop. If the property does not exist, it will be created. If $val is a string and the list is empty or does not exist, a new list with one value will be created.
string|integer | $distinct_id | the distinct_id or alias of a user |
string | $prop | the property that holds the list |
string|array | $val | items to add to the list |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
trackCharge(string|integer $distinct_id, string $amount, null $timestamp = null, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Adds a transaction to the user's profile for revenue tracking
string|integer | $distinct_id | the distinct_id or alias of a user |
string | $amount | the transaction amount e.g. "20.50" |
null | $timestamp | the timestamp of when the transaction occurred (default to current timestamp) |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
clearCharges(string|integer $distinct_id, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Clear all transactions stored on a user's profile
string|integer | $distinct_id | the distinct_id or alias of a user |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
deleteUser(string|integer $distinct_id, string|null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false)
Delete this profile from Mixpanel
string|integer | $distinct_id | the distinct_id or alias of a user |
string|null | $ip | the ip address of the client (used for geo-location) |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |
_getConsumer() : \ConsumerStrategies_AbstractConsumer
Given a strategy type, return a new PersistenceStrategy object
_constructPayload( $distinct_id, $operation, $value, null $ip = null, boolean $ignore_time = false, boolean $ignore_alias = false) : array
Internal method to prepare a message given the message data
$distinct_id | ||
$operation | ||
$value | ||
null | $ip | |
boolean | $ignore_time | If the $ignore_time property is true, Mixpanel will not automatically update the "Last Seen" property of the profile. Otherwise, Mixpanel will add a "Last Seen" property associated with the current time |
boolean | $ignore_alias | If the $ignore_alias property is true, an alias look up will not be performed after ingestion. Otherwise, a lookup for the distinct ID will be performed, and replaced if a match is found |