MoEAnalyticsHelper

object MoEAnalyticsHelper

Helper class to track data on the MoEngage Platform.

Since

12.0.00

Author

Umang Chamaria

Functions

setAlias
Link copied to clipboard
fun setAlias(context: Context, alias: Any)
fun setAlias(context: Context, alias: Any, appId: String)

Set an Alias to update the existing Unique Id Note: This API only accepts the below data-types:

setAppStatus
Link copied to clipboard
fun setAppStatus(context: Context, status: AppStatus)
fun setAppStatus(context: Context, status: AppStatus, appId: String)

This API tells the SDK whether it is a fresh install or an existing application was updated.

setBirthDate
Link copied to clipboard
fun setBirthDate(context: Context, birthDate: Date)

Helper method to set User's Birth Date.

fun setBirthDate(context: Context, isoDate: String)
fun setBirthDate(context: Context, isoDate: String, appId: String)

Helper method to set user's Birth Date. Supported format - yyyy-MM-dd|yyyyMMdd[T(hh:mm[:ss.sss]|hhmm[ss.sss])]?[Z|+-hh:mm]]

fun setBirthDate(context: Context, birthDate: Date, appId: String)

Helper method to set User BirthDate

setEmailId
Link copied to clipboard
fun setEmailId(context: Context, value: String)
fun setEmailId(context: Context, value: String, appId: String)

Helper method to set user email

setFirstName
Link copied to clipboard
fun setFirstName(context: Context, value: String)
fun setFirstName(context: Context, value: String, appId: String)

Helper method to set User first Name

setGender
Link copied to clipboard
fun setGender(context: Context, gender: UserGender)
fun setGender(context: Context, gender: UserGender, appId: String)

Helper method to set user gender

setLastName
Link copied to clipboard
fun setLastName(context: Context, value: String)
fun setLastName(context: Context, value: String, appId: String)

Helper method to set User Last Name

setLocation
Link copied to clipboard
fun setLocation(context: Context, lat: Double, lng: Double)
fun setLocation(context: Context, lat: Double, lng: Double, appId: String)

Track user location as a User Attribute

setMobileNumber
Link copied to clipboard
fun setMobileNumber(context: Context, value: String)
fun setMobileNumber(context: Context, value: String, appId: String)

Helper method to set User Number

setUniqueId
Link copied to clipboard
fun setUniqueId(context: Context, uniqueId: Any)
fun setUniqueId(context: Context, uniqueId: Any, appId: String)

Set an Unique Identifier for the user.

setUserAttribute
Link copied to clipboard
fun setUserAttribute(context: Context, attributes: Map<String, Any>)
fun setUserAttribute(context: Context, attributes: Map<String, Any>, appId: String)

Set the user attributes with the attributes specified in the HashMap

fun setUserAttribute(context: Context, attributeName: String, attributeValue: Any)

Track a user attribute in the default instance.

fun setUserAttribute(context: Context, name: String, value: Any, appId: String)

Track a user attribute in the given account.

setUserAttributeEpochTime
Link copied to clipboard
fun setUserAttributeEpochTime(context: Context, name: String, value: Long)
fun setUserAttributeEpochTime(context: Context, name: String, value: Long, appId: String)

Sets the given epoch time for the given user.

setUserAttributeISODate
Link copied to clipboard
fun setUserAttributeISODate(context: Context, attributeName: String, attributeValue: String)
fun setUserAttributeISODate(context: Context, attributeName: String, attributeValue: String, appId: String)

Set a date type user attribute for the current user.

setUserName
Link copied to clipboard
fun setUserName(context: Context, value: String)
fun setUserName(context: Context, value: String, appId: String)

Helper method to set user full name

trackDeviceLocale
Link copied to clipboard
fun trackDeviceLocale(context: Context)
fun trackDeviceLocale(context: Context, appId: String)

Tracks device locale.

trackEvent
Link copied to clipboard
fun trackEvent(context: Context, eventName: String, properties: Properties)
fun trackEvent(context: Context, eventName: String, properties: Properties, appId: String)

Track user behaviour as events with properties.

trackUserPushPreference
Link copied to clipboard
fun trackUserPushPreference(context: Context, pushPreference: Boolean)
fun trackUserPushPreference(context: Context, pushPreference: Boolean, appId: String)

Set user's push preference.