Mobile App Event Tracking (For 8.x)

With v8 onwards of the MobilePush SDK, you can track analytic events about end users’ actions with the app. Your app calls new methods in the MobilePush SDK to track events. These events can be used to orchestrate journeys or trigger in-app messages based on real-time user behavior.

To start tracking events, ensure that you are on the v8 and above of the SDK. See Migration

Implement Event Tracking

A tracked event consists of the event name and event attributes (optional parameters). Your app builds an event object based on your business requirements and then passes it to the MobilePush SDK. Ensure that the event implemented in the SDK is identical to the event defined in the Marketing Cloud UI.

Create the event

val event = EventManager.customEvent("EventName", mapOf("key1" to "value2", "key2" to "value2"))

Track the event

SFMCSdk.track(event)