User & Event Tracking

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

Here is the reference for the Sample Events Sheet by business vertical

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

Please ensure that you have done base SDK integration

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
          };
Smartech().updateUserProfile(map);

📘

Note

  • Smartech supports following data types - String, Integer, Float, Date.
  • Date should be sent as yyyy-mm-dd format
  1. 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.

Smartech().setUserIdentity(<USER'S_IDENTITY>);
  1. 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.

Smartech().login(<USER'S_IDENTITY>);
  1. Clear Identity

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

Smartech().clearUserIdentity();
  1. 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

Smartech().logoutAndClearUserIdentity(booleanClearIdentity);

Installation Event Tracking

Refer here for Android.

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,

}

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

Location Tracking

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

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

GDPR Opt-in & Opt-out

Opt for Tracking

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

bool hasOpt = Smartech().hasOptedTracking();

Opt For Push Notifications

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

bool hasOpt = Smartech().hasOptedPushNotification();

Opt For In-App Messages

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

bool hasOpt = Smartech().hasOptedInAppMessage();