Tracking User Attributes 2.x.x

Notifying the SDK when the user logs out of the app

c#
using MoEngage;
MoEngageClient.Logout();

Updating Unique Identifier

In a scenario where you have to update the Unique Identifier value for an already logged-in user use SetAlias()

c#
using MoEngage;
MoEngageClient.SetAlias();
warning

Warning

Please make sure that you use SetAlias() for updating the Unique Identifier and not SetUniqueId() as calling SetUniqueId() with a new value will reset the current user and lead to the creation of unintended users in our system.

Tracking User Attributes

To track user attributes line First Name, Last Name, email, phone number, etc use the below APIs

c#
using MoEngage;
MoEngageClient.SetFirstName();
MoEngageClient.SetLastName();
MoEngageClient.SetEmail();
MoEngageClient.SetUniqueId();
MoEngageClient.SetPhoneNumber();
MoEngageClient.SetGender();

For setting other User Attributes you can use generic method SetUserAttribute(key,value)

c#
using MoEngage;
MoEngageClient.SetUserAttribute();

Tracking Date as user attributes

To track any date as user attributes use the MoEngageClient.SetUserAttributeISODate(). This API takes attribute name and ISO Date as input.
Date Format - yyyy-MM-dd'T'HH:mm:ss.fff'Z'
Example:

c#
using MoEngage;
MoEngageClient.SetUserAttributeISODate("userAttrDate", "2019-01-02T08:26:21.170Z");

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?