public final class PureMetrics
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PureMetrics.Builder
A Builder class for
PureMetrics. |
static class |
PureMetrics.GENDER
User Gender identifier
|
static class |
PureMetrics.LOG_LEVEL
Available logging levels for the SDK
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isActivityInForground()
Check to see if the app is running in foreground or background
|
static void |
setUserAge(int age)
Set the user age
|
static void |
setUserEmailAddress(java.lang.String emailAddress)
Set user primary email id
|
static void |
setUserGender(PureMetrics.GENDER gender)
Set user gender
|
static void |
setUserId(java.lang.String userId)
Set user User Id.
|
static void |
setUserName(java.lang.String firstName,
java.lang.String lastName)
Set the user name
|
static void |
setUserPhoneNumber(java.lang.String phoneNumber)
Set User phone number
|
static void |
trackDeviceProperties(java.lang.String deviceProperty,
boolean propertyValue)
Track a device property/trait.
|
static void |
trackDeviceProperties(java.lang.String deviceProperty,
double propertyValue)
Track a device property/trait.
|
static void |
trackDeviceProperties(java.lang.String deviceProperty,
int propertyValue)
Track a device property/trait.
|
static void |
trackDeviceProperties(java.lang.String deviceProperty,
java.lang.String propertyValue)
Track a user property/trait.
|
static void |
trackEvent(java.lang.String eventName)
Track an event which was performed by the user
|
static void |
trackEvent(java.lang.String eventName,
java.util.HashMap<java.lang.String,java.lang.Object> attributes)
Track an event and its associated event attribute.
|
static void |
trackSessionStart()
Explicitly track Session start.
|
static void |
trackSessionStart(java.util.HashMap extras)
Explicitly track Session start.
|
static void |
trackSessionStart(java.lang.String referrer,
java.lang.String type)
Explicitly track Session start.
|
static void |
trackUserProperties(java.lang.String userProperty,
boolean propertyValue)
Track a user property/trait.
|
static void |
trackUserProperties(java.lang.String userProperty,
double propertyValue)
Track a user property/trait.
|
static void |
trackUserProperties(java.lang.String userProperty,
int propertyValue)
Track a user property/trait.
|
static void |
trackUserProperties(java.lang.String userProperty,
java.lang.String propertyValue)
Track a user property/trait.
|
static PureMetrics.Builder |
withBuilder()
Helper method to get an instance of the
PureMetrics.Builder to configure the SDK |
public static PureMetrics.Builder withBuilder()
PureMetrics.Builder to configure the SDKPureMetrics.Builder classpublic static boolean isActivityInForground()
public static void trackEvent(java.lang.String eventName)
eventName - The name of the eventpublic static void trackEvent(java.lang.String eventName,
java.util.HashMap<java.lang.String,java.lang.Object> attributes)
eventName - The name of the eventattributes - A HashMap of the event attributespublic static void trackUserProperties(java.lang.String userProperty,
java.lang.String propertyValue)
userProperty - Name of the user propertypropertyValue - String Value associated with the user propertypublic static void trackUserProperties(java.lang.String userProperty,
int propertyValue)
userProperty - Name of the user propertypropertyValue - int Value associated with the user propertypublic static void trackUserProperties(java.lang.String userProperty,
double propertyValue)
userProperty - Name of the user propertypropertyValue - double Value associated with the user propertypublic static void trackUserProperties(java.lang.String userProperty,
boolean propertyValue)
userProperty - Name of the user propertypropertyValue - boolean Value associated with the user propertypublic static void trackDeviceProperties(java.lang.String deviceProperty,
java.lang.String propertyValue)
deviceProperty - Name of the device propertypropertyValue - String Value associated with the user propertypublic static void trackDeviceProperties(java.lang.String deviceProperty,
int propertyValue)
deviceProperty - Name of the device propertypropertyValue - Integer Value associated with the user propertypublic static void trackDeviceProperties(java.lang.String deviceProperty,
double propertyValue)
deviceProperty - Name of the device propertypropertyValue - Double Value associated with the user propertypublic static void trackDeviceProperties(java.lang.String deviceProperty,
boolean propertyValue)
deviceProperty - Name of the device propertypropertyValue - Boolean Value associated with the user propertypublic static void trackSessionStart()
PureMetrics.Builder.disableAutoTracking(boolean) as truepublic static void trackSessionStart(java.util.HashMap extras)
PureMetrics.Builder.disableAutoTracking(boolean) as trueextras - An extras which need to be tracked which gives more insight regarding the source of launchpublic static void trackSessionStart(java.lang.String referrer,
java.lang.String type)
PureMetrics.Builder.disableAutoTracking(boolean) as truereferrer - The referrer for the session. This can be a notification, launcher, defaulttype - The type of usage, like within app, external etc.public static void setUserName(java.lang.String firstName,
java.lang.String lastName)
firstName - First Name of the userlastName - Last Name of the userpublic static void setUserAge(int age)
age - Age of the userpublic static void setUserGender(PureMetrics.GENDER gender)
gender - gender value. Possible values PureMetrics.GENDER.FEMALE and PureMetrics.GENDER.MALEpublic static void setUserId(java.lang.String userId)
userId - The user id of the userpublic static void setUserEmailAddress(java.lang.String emailAddress)
emailAddress - The primary email address of the userpublic static void setUserPhoneNumber(java.lang.String phoneNumber)
phoneNumber - The phone number of the user