These docs are for v1.0. Click to read the latest docs for v2.0.

Tracking User

User Profile

There are cases where additional information associated with a user can be passed as user attributes. These attributes can be used to segment users and target campaigns to a specific group. Attributes can also be used to send more personalize campaign messages to each user.

NetcoreSDK.profile(USER_PROFILE_DETIAL_PAYLOAD);

// Sample code for reference purpose only
const payloadata = {
      NAME: "User Name",
			EMAILID: "[email protected]",
			AGE: "30",
			MOBILE: "4545748"
    };
NetcoreSDK.profile(payloadata);

📘

NOTE:

  • Smartech supports following data types - String, Integer, Float, Date, Array, Objects.
  • Bool/Boolean data type in the payload is NOT supported by Smartech.
  • Date should be sent as yyyy-mm-dd format

Identifying users

Use the below method to set a user’s identity. In case the user’s identity is not available at login, you can also use this method after availability of identity and after setting identity all corresponding event will be mapped to this identity.

NetcoreSDK.setIdentity(USERS_IDENTITY);

Login Event

Call Smartech login method as soon as user succusfully login into the app and also set user’s identity before calling the login method of SDK.

NetcoreSDK.login(USERS_IDENTITY);

Clear Identity

This will clear the user’s identity and after this, all activity will be tracked as anonymous.

NetcoreSDK.clearIdentity();

Logout Event

Call Smartech logout method after user log-out from the application.

NetcoreSDK.logout();
NetcoreSDK.clearIdentity();

📘

NOTE:

Avoid calling clearIdentity() method if one wants to track user activity even if the user has logged out of the application.