analytics v0.3.0 Analytics.Mixpanel.People

This module is responsible for building a struct which is later can be used to send all changes via batch request to the Mixpanel.

Whenever batch request is submitted it’s validated as whole, so that if one of entries is invalid there would be no changes applied to a user.

Link to this section Summary

Functions

Appends each to a list associated with the corresponding property name. Appending to a property that doesn’t exist will result in assigning a list with one element to that property

When processed, the property values are added to the existing values of the properties on the profile. If the property is not present on the profile, the value will be added to 0. It is possible to decrement by calling “$add” with negative values. This is useful for maintaining the values of properties like “Number of Logins” or “Files Uploaded”

Creates a new People struct that updates person with a distinct_id

Updates the profile attribute. 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

The IP address associated with a given profile, which Mixpanel uses to guess user geographic location. Ignored if not set

Works just like set/2, except it will not overwrite existing property values. This is useful for properties like “First login date”

Creates or updates user profile with operations from People struct

Adds a transactions to the individual user profile, which will also be reflected in the Mixpanel Revenue report

The list values in the request are merged with the existing list on the user profile, ignoring duplicates

Removes the profile attribute

Link to this section Functions

Link to this function append(batch_request, key, value)

Appends each to a list associated with the corresponding property name. Appending to a property that doesn’t exist will result in assigning a list with one element to that property.

For more details see submit/2.

Link to this function increment(batch_request, key, value \\ 1)

When processed, the property values are added to the existing values of the properties on the profile. If the property is not present on the profile, the value will be added to 0. It is possible to decrement by calling “$add” with negative values. This is useful for maintaining the values of properties like “Number of Logins” or “Files Uploaded”.

For more details see submit/2.

Link to this function new(distinct_id)

Creates a new People struct that updates person with a distinct_id.

Link to this function set(batch_request, key, value)

Updates the profile attribute. 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.

For more details see submit/2.

Link to this function set_ip(batch_request, ip)

The IP address associated with a given profile, which Mixpanel uses to guess user geographic location. Ignored if not set.

Link to this function set_once(batch_request, key, value)

Works just like set/2, except it will not overwrite existing property values. This is useful for properties like “First login date”.

For more details see submit/2.

Link to this function submit(batch_request, opts \\ [])

Creates or updates user profile with operations from People struct.

Options

  • :update_last_seen - If the :update_last_seen property is true, automatically updates the “Last Seen” property of the profile. Otherwise, Mixpanel will add a “Last Seen” property associated with the current time for all $set, $append, and $add operations. Default: false.
Link to this function track_charge(batch_request, amount, metadata \\ %{})

Adds a transactions to the individual user profile, which will also be reflected in the Mixpanel Revenue report.

For more details see submit/2.

Link to this function union(batch_request, key, list)

The list values in the request are merged with the existing list on the user profile, ignoring duplicates.

For more details see submit/2.

Link to this function unset(batch_request, key)

Removes the profile attribute.

For more details see submit/2.