Capturing Behavior Data
The Data Cloud Module for the Engagement Mobile SDK enables the collection of granular data about a customer’s mobile app interactions through event tracking.
Before behavior data can be sent to Data Cloud:
- The Data Cloud Module for the Engagement Mobile SDK must be configured and initialized.
- To enable Lifecycle Events, set trackLifecycle to true.
- To enable Screen Events, set trackScreens to true.
- Consent to track must be granted.
Behavioral lifecycle and screen events are disabled by default in the Data Cloud Module.
Each of the behaviors generates an engagement event with eventType="appEvents"
and fields relevant to the behavior populated.
Lifecycle behaviors are triggered when a mobile application transitions to the foreground or background on a mobile device, or when the mobile application is updated.
On Application Foregrounded
For example, when the mobile application is foregrounded, an event is generated.
The first time the application launches, behaviorType="AppFirstLaunch"
is set.
On Application Backgrounded
For example, when the mobile application is backgrounded an event is generated.
On Application Version Changed
For example, when the mobile application is updated, an event is generated.
On-Screen View
For example, when a customer is navigating through Activity views in an Android application, or as UIViewControllers are added to a view hierarchy in iOS, an event is generated.
After you’ve configured the Data Cloud Module and enabled the desired behavioral events, the SDK automatically sends those events to Data Cloud as they occur in your app. You don't need to manually send these events.