MoEAnalyticsHelper

Helper class to track data on the MoEngage Platform.

Author

Umang Chamaria

Since

12.0.00

Functions

Link copied to clipboard
@WorkerThread
fun getUserIdentities(context: Context, workspaceId: String? = null): Map<String, String>?

Identities of the user that has been set.

Link copied to clipboard
fun identifyUser(context: Context, identity: String, workspaceId: String? = null): MoETask<UserIdentityResult>
fun identifyUser(context: Context, identity: Map<String, String>, workspaceId: String? = null): MoETask<UserIdentitiesResult>

Identify the user with the given identifiers.

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:

Link copied to clipboard
fun setAppStatus(context: Context, status: AppStatus, appId: String? = null): MoETask<AppStatusResult>

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

Link copied to clipboard

Helper method to set User's Birth Date.

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]]

Helper method to set User BirthDate

Link copied to clipboard
fun setDeviceAttribute(context: Context, attributeName: String, attributeValue: Any, workspaceId: String? = null): MoETask<DeviceAttributeResult>

Set device attribute for the given workspace id instance (if null, then default instance). Supported value data types are:

Link copied to clipboard

Helper method to set user email

Link copied to clipboard

Helper method to set User first Name

Link copied to clipboard

Helper method to set user gender

Link copied to clipboard

Helper method to set User Last Name

Link copied to clipboard
fun setLocation(context: Context, lat: Double, lng: Double, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT): MoETask<UserAttributeResult.Standard>

Track user location as a User Attribute

Link copied to clipboard

Helper method to set User Number

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.

Link copied to clipboard
fun setUserAttribute(context: Context, attributes: Map<String, Any>, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT): MoETask<UserAttributeResult.Bulk>

Set the user attributes with the attributes specified in the HashMap

fun setUserAttribute(context: Context, attributeName: String, attributeValue: Any, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT): MoETask<UserAttributeResult.Standard>

Track a user attribute in the default instance.

Link copied to clipboard
fun setUserAttributeEpochTime(context: Context, name: String, value: Long, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT): MoETask<UserAttributeResult.EpochTime>

Sets the given epoch time for the given user.

Link copied to clipboard
fun setUserAttributeISODate(context: Context, attributeName: String, attributeValue: String, appId: String? = null, attributeLevel: UserAttributeLevel = UserAttributeLevel.PROJECT): MoETask<UserAttributeResult.ISODate>

Set a date type user attribute for the current user.

Link copied to clipboard

Helper method to set user full name

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

Track user behaviour as events with properties.

Link copied to clipboard

Set user's push preference.