View on GitHub

Mixpanel Unity SDK

mixpanel.Mixpanel Class Reference

Core class for interacting with Mixpanel Analytics. More...

Inheritance diagram for mixpanel.Mixpanel:

Classes

class  People
 Core interface for using Mixpanel People Analytics features. You can get an instance by calling Mixpanel.people More...
 

Static Public Member Functions

static void Alias (string alias)
 Creates a distinct_id alias. More...
 
static void ClearSuperProperties ()
 Clear all super properties. More...
 
static void ClearTimedEvents ()
 Clears all current event timers. More...
 
static bool ClearTimedEvent (string eventName)
 Clears the event timer for a single event. More...
 
static void FlushQueue ()
 Uploads queued data to the Mixpanel server. More...
 
static void Identify (string uniqueId)
 Sets the distinct ID of the current user. More...
 
static void Register (string key, Value value)
 Registers super properties, overwriting ones that have already been set. More...
 
static bool RegisterOnce (string key, Value value)
 Registers super properties without overwriting ones that have already been set. More...
 
static void Reset ()
 Clears all distinct_ids, superProperties, and push registrations from persistent storage. Will not clear referrer information. More...
 
static bool StartTimedEvent (string eventName)
 Start timing of an event. Calling Mixpanel.StartTimedEvent(string eventName) will not send an event, but when you eventually call Mixpanel.Track(string eventName), your tracked event will be sent with a "$duration" property, representing the number of seconds between your calls. More...
 
static bool StartTimedEventOnce (string eventName)
 Begin timing of an event, but only if the event has not already been registered as a timed event. Useful if you want to know the duration from the point in time the event was first registered. More...
 
static void Track (string eventName)
 Tracks an event. More...
 
static void Track (string eventName, Value properties)
 Tracks an event with properties. More...
 
static bool Unregister (string key)
 Removes a single superProperty. More...
 

Properties

static People people [get]
 Return an accessor for Mixpanel people with a temporary distinct id. More...
 

Detailed Description

Core class for interacting with Mixpanel Analytics.

Create a GameObject and attach this Mixpanel component. Then, set the properties in the unity inspector (token, debug token, etc.)

Use the Mixpanel class to set up your project and track events in Mixpanel Engagement. Once you have a component, you can track events in Mixpanel Engagement using Mixpanel.Track(string eventName). You can also update People Analytics records with Mixpanel.people.

//Track an event in Mixpanel Engagement
Mixpanel.track("Hello World");
Mixpanel.Identify("CURRENT USER DISTINCT ID");
Mixpanel.people.Set("Plan", "Premium");

Member Function Documentation

static void mixpanel.Mixpanel.Alias ( string  alias)
inlinestatic

Creates a distinct_id alias.

Parameters
aliasthe new distinct_id that should represent original
static void mixpanel.Mixpanel.ClearSuperProperties ( )
inlinestatic

Clear all super properties.

static bool mixpanel.Mixpanel.ClearTimedEvent ( string  eventName)
inlinestatic

Clears the event timer for a single event.

Parameters
eventNamethe name of event to clear event timer
static void mixpanel.Mixpanel.ClearTimedEvents ( )
inlinestatic

Clears all current event timers.

static void mixpanel.Mixpanel.FlushQueue ( )
inlinestatic

Uploads queued data to the Mixpanel server.

static void mixpanel.Mixpanel.Identify ( string  uniqueId)
inlinestatic

Sets the distinct ID of the current user.

Parameters
uniqueIda 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.
static void mixpanel.Mixpanel.Register ( string  key,
Value  value 
)
inlinestatic

Registers super properties, overwriting ones that have already been set.

Parameters
keyname of the property to register
valuevalue of the property to register
static bool mixpanel.Mixpanel.RegisterOnce ( string  key,
Value  value 
)
inlinestatic

Registers super properties without overwriting ones that have already been set.

Parameters
keyname of the property to register
valuevalue of the property to register
static void mixpanel.Mixpanel.Reset ( )
inlinestatic

Clears all distinct_ids, superProperties, and push registrations from persistent storage. Will not clear referrer information.

static bool mixpanel.Mixpanel.StartTimedEvent ( string  eventName)
inlinestatic

Start timing of an event. Calling Mixpanel.StartTimedEvent(string eventName) will not send an event, but when you eventually call Mixpanel.Track(string eventName), your tracked event will be sent with a "$duration" property, representing the number of seconds between your calls.

Parameters
eventNamethe name of the event to track with timing
static bool mixpanel.Mixpanel.StartTimedEventOnce ( string  eventName)
inlinestatic

Begin timing of an event, but only if the event has not already been registered as a timed event. Useful if you want to know the duration from the point in time the event was first registered.

Parameters
eventNamethe name of the event to track with timing
static void mixpanel.Mixpanel.Track ( string  eventName)
inlinestatic

Tracks an event.

Parameters
eventNamethe name of the event to send
static void mixpanel.Mixpanel.Track ( string  eventName,
Value  properties 
)
inlinestatic

Tracks an event with properties.

Parameters
eventNamethe name of the event to send
propertiesA JSONObject containing the key value pairs of the properties to include in this event. Pass null if no extra properties exist.
static bool mixpanel.Mixpanel.Unregister ( string  key)
inlinestatic

Removes a single superProperty.

Parameters
keyname of the property to unregister

Property Documentation

People mixpanel.Mixpanel.people
staticget

Return an accessor for Mixpanel people with a temporary distinct id.


The documentation for this class was generated from the following file:
  • Mixpanel.cs