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.

Smartech.profile(USER_PROFILE_DETIAL_PAYLOAD);

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

📘

NOTE:

All the keys in the payload dictionary should be in capital letters

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.

Smartech.setIdentity("USER'S_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.

Smartech.login("USER'S_IDENTITY");

Clear Identity

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

Smartech.clearIdentity();

Logout Event

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

Smartech.logout();
Smartech.clearIdentity();

📘

NOTE:

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