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.FailedTransaction
A Class that represents a single complete transaction
|
static class |
PureMetrics.LOG_LEVEL
Available logging levels for the SDK
|
static class |
PureMetrics.Order
A Class that represents a single complete Order
|
static class |
PureMetrics.Revenue
A Class that represents a single complete transaction
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isActivityInForground()
Check to see if the app is running in foreground or background
|
static void |
resetUserInfo()
To be called when a user signs out.
|
static void |
setExistingUser()
Set the current user an existing user.
|
static void |
setUserBirthDate(java.util.Date birthDate)
Set User Birthdate
|
static void |
setUserEmailAddress(java.lang.String emailAddress)
Set user primary email id
|
static void |
setUserGender(java.lang.String 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 |
trackCrash(java.util.HashMap<java.lang.String,java.lang.Object> meta)
To be called from a Crash listener like the one in
CrashlyticsListener#crashlyticsDidDetectCrashDuringPreviousExecution
|
static void |
trackDeeplinkAttribution(java.lang.String source,
java.lang.String medium,
java.lang.String campaign,
java.lang.String deeplink,
java.util.HashMap<java.lang.String,java.lang.Object> extras)
Track Deeplink attribution for app open or install
|
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,
java.util.HashMap attributes)
Track an event and its associated event attribute.
|
static void |
trackSessionStart(java.util.HashMap<java.lang.String,java.lang.Object> extras)
Explicitly track Session start.
|
static void |
trackSessionStart(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 void |
transactionFailed(PureMetrics.FailedTransaction transaction)
Track a failed transaction
|
static void |
transactionStarted(PureMetrics.Order order)
Track start of a transaction
|
static void |
transactionSuccessful(PureMetrics.Revenue revenue)
Track start of a transaction
|
static PureMetrics.Builder |
withBuilder()
Helper method to get an instance of the
PureMetrics.Builder to configure the SDK |
public static void trackDeeplinkAttribution(java.lang.String source,
java.lang.String medium,
java.lang.String campaign,
java.lang.String deeplink,
java.util.HashMap<java.lang.String,java.lang.Object> extras)
source - Source of any campaign if the app was opened from a campaignmedium - Medium of the campaign: email/notification/adscampaign - Campaign name if anydeeplink - Deeplink of the app launch if it was launched from a deeplinkextras - HashMap of meta data related to app start. These are custom extraspublic static PureMetrics.Builder withBuilder()
PureMetrics.Builder to configure the SDKPureMetrics.Builder classpublic static boolean isActivityInForground()
public static void resetUserInfo()
public static void trackEvent(java.lang.String eventName,
java.util.HashMap attributes)
eventName - The name of the eventattributes - A HashMap of the event attributespublic static void trackCrash(java.util.HashMap<java.lang.String,java.lang.Object> meta)
meta - any additional metadata that you would like to track.public 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(java.util.HashMap<java.lang.String,java.lang.Object> 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 type)
PureMetrics.Builder.disableAutoTracking(boolean) as truetype - The type of usage, like within app, external etc.public static void transactionStarted(PureMetrics.Order order)
order - The PureMetrics.Order for which the transaction startedpublic static void transactionSuccessful(PureMetrics.Revenue revenue)
revenue - The PureMetrics.Revenue generated from a successful transactionpublic static void transactionFailed(PureMetrics.FailedTransaction transaction)
transaction - A populated PureMetrics.FailedTransaction objectpublic static void setExistingUser()
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 setUserBirthDate(java.util.Date birthDate)
birthDate - Set User Birthdatepublic static void setUserGender(java.lang.String gender)
gender - gender value.public 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