Custom Trackings

NearIT allows to track user engagement events on recipes. Any recipe has at least two default events:

  • Received: the user received a notification
  • Opened: the user tapped on the notification

Usually the SDK tracks those events automatically, but if you write custom code to show notification or content (i.e. to receive Beacon interaction content) please make sure that at least the "Received" event is tracked.
Warning: Failing in tracking this event cause some NearIT features to not work.

You can track default or custom events using the sendTracking method:

// notified - notification received
NearItManager.getInstance().sendTracking(trackingInfo, Recipe.RECEIVED);
// engaged - notification tapped
NearItManager.getInstance().sendTracking(trackingInfo, Recipe.OPENED);
// custom recipe event
NearItManager.getInstance().sendTracking(trackingInfo, "my awesome custom event");
// notified - notification received
NearItManager.getInstance().sendTracking(trackingInfo, Recipe.RECEIVED)
// engaged - notification tapped
NearItManager.getInstance().sendTracking(trackingInfo, Recipe.OPENED)
// custom recipe event
NearItManager.getInstance().sendTracking(trackingInfo, "my awesome custom event")