User & Event Tracking

CEE SDK allows you to track user behavior and build rich user profiles which then can be used to create segments & target them with personalized communication.

Based on your use cases, please follow the steps to get started with user tracking and events tracking.

User Tracking

1. Building User Profile

You can pass additional information associated with a user to Smartech as user attributes as shown below.

var map = {
           "first_name": “ram”,
           "last_name": “Sharma”,
           "age": 25
          };
SmartechPlugin().updateUserProfile(map);

📘

Note

  • Smartech supports following data types - String, Integer, Float, Date, Array, Objects.
  • Date should be sent as yyyy-mm-dd format

2. 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 the identity is available.

SmartechPlugin().setUserIdentity("<USER'S_IDENTITY>");

3. Login Event

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

SmartechPlugin().login("<USER'S_IDENTITY>");

4. Clear Identity

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

SmartechPlugin().clearUserIdentity();

5. Logout Event

Call the Smartech logout method after the user log-out from the application. If you want to clear the user identity pass true in the parameter. When you logout the user with identity clear, you won't be receiving any personalized push notifications

SmartechPlugin().logoutAndClearUserIdentity(booleanClearIdentity);

Installation Event Tracking

For Android:-
https://cedocs.netcorecloud.com/docs/android-installation-event-tracking

For iOS:-
https://cedocs.netcorecloud.com/docs/user-event-tracking-1

Custom Event Tracking

This method is used to track custom events that are defined by the client, to which you can analyze users' usage patterns of the product. Each event must have a name and a set of attributes describing more about the event in detail.

Var payload = {

"name”:”Nexus 5”,
"prid”,:2,
"price”: 15000.00,
"prqt”: 1,

}

SmartechPlugin().trackEvent("Add To Cart", payload);

Location Tracking

You can track user's location or set it yourself by following the below steps.

SmartechPlugin().setUserLocation(<lat_in_double>, <long_in_double>);

GDPR Opt-in & Opt-out

Opt for Tracking

bool isOpt = true/false
SmartechPlugin().optTracking(isOpt);

bool hasOpt = SmartechPlugin().hasOptedTracking();

Opt For Push Notifications

bool isOpt = true/false
SmartechPlugin().optPushNotification(isOpt);

bool hasOpt = SmartechPlugin().hasOptedPushNotification();

Opt For In-App Messages

bool isOpt = true/false
SmartechPlugin().optInAppMessage(isOpt);

bool hasOpt = SmartechPlugin().hasOptedInAppMessage();