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 |
setAppOpenExtras(java.lang.String source,
java.lang.String medium,
java.lang.String type,
java.lang.String campaign,
java.lang.String deeplink,
java.util.HashMap<java.lang.String,java.lang.Object> extras)
Add meta data to the session stating details of the app launch like,
whether it was launched from a deep link present in a campaign, notification etc
|
static void |
setExistingUser()
Set the current user an existing user.
|
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 |
trackRevenue(float amount,
java.lang.String currency,
java.lang.String paymentMode,
float discountValue,
java.lang.String discountCode,
float currencyConversion,
java.util.HashMap<java.lang.String,java.lang.Object> attributes)
Track revenue
|
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 void setAppOpenExtras(java.lang.String source,
java.lang.String medium,
java.lang.String type,
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/adstype - Type of session like if this is from the app or a floating bubble on screencampaign - 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 trackRevenue(float amount,
java.lang.String currency,
java.lang.String paymentMode,
float discountValue,
java.lang.String discountCode,
float currencyConversion,
java.util.HashMap<java.lang.String,java.lang.Object> attributes)
amount - The revenue amountcurrency - Currency valuepaymentMode - Payment modediscountValue - Discount amount if anydiscountCode - Discount code usedcurrencyConversion - The currency conversion value or 1 if no conversion is requiredattributes - Meta data associated with the revenue event.
Example: name, product, category, location etcpublic 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 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 setUserAge(int age)
age - Age of the userpublic static void setUserGender(PureMetrics.GENDER gender)
gender - gender value. Possible values PureMetrics.GENDER.MALE and PureMetrics.GENDER.FEMALEpublic 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