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 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:

// received - notification received
manager.sendTracking(trackingInfo, event: NearRecipeTracking.received.rawValue)

// opened - notification tapped
manager.sendTracking(trackingInfo, event: NearRecipeTracking.opened.rawValue)

// custom recipe event
manager.sendTracking(trackingInfo, event: "my awesome custom event")
// received - notified received
[manager sendTrackingWithTrackingInfo:trackingInfo event:NITRecipeReceived];

// opened - notification tapped
[manager sendTrackingWithTrackingInfo:trackingInfo event:NITRecipeOpened];

// custom recipe event
[manager sendTrackingWithTrackingInfo:trackingInfo event:@"my awesome custom event"];