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

Tracking Events

Introduction

Events are the actions performed by the user on the mobile application. Smartech SDK enables you to record these user events and later learn more about your app’s usage patterns and to segment your users, target and personalize messaging based on the events performed by them.

Predefined Events on Smartech Panel

Following is the list of Predefined events that are created on the panel which you can use if you want to:

  • Page Browse
  • Add To Cart
  • Checkout
  • Expiry Cart
  • Remove From Cart
  • Page Exit
  • Product Search
  • Product View
  • Lead Submitted
  • Product Purchase
  • Add to Wishlist
  • Remove from Wishlist

Tracking Custom Events

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

HashMap<String, Object> payload = new HashMap<>();
payload.put("name", "Nexus 5");
payload.put("prid", 2);
payload.put("price", 15000.00);
payload.put("prqt", 1);

Smartech.getInstance(new WeakReference<Context>(context)).trackEvent("Add To Cart", payload);
val payload : HashMap<String, Any> = HashMap<String, Any> ()
payload["name"] = "Nexus 5"
payload["prid"] = 2
payload["price"] = 15000.00
payload["prqt"] = 1

Smartech.getInstance(WeakReference(context)).trackEvent("Add To Cart", payload)

📘

Note:

  • Smartech will automatically discover new custom activity by activity name along with payload parameters and data types.
    • Smartech supports following data types - String, Integer, Float, Date, Array, JOSNObject.
    • Bool data type in payload is not supported by Smartech.
    • Smartech will automatically convert the activity name into lowercase.
    • All the payload keys must be in lower cases.
    • Please provide the value of date in YYYY-MM-dd HH:mm:ss format.