Capture Behavior Data

This page applies to both Version 2.x and Version 3.x of the Engagement Mobile SDK.

Note

The Data 360 Module for the Engagement Mobile SDK enables comprehensive collection of granular data about customer mobile app interactions through advanced event tracking capabilities.

Prerequisites 

Before behavior data can be sent to Data 360, ensure the following:

  • SDK Configuration: The Data 360 Module must be properly configured and initialized.
    • Enable Lifecycle Events by setting trackLifecycle to true
    • Enable Screen Events by setting trackScreens to true
  • Consent Management: Consent to track user data must be granted.

Default Settings 

Behavioral lifecycle and screen events are disabled by default in the Data 360 Module for privacy compliance.

Event Generation 

Each behavior generates an engagement event with eventType="appEvents" and relevant behavior-specific fields populated.

Lifecycle Events 

Lifecycle events are automatically triggered when your mobile app transitions between foreground and background states, or when the application is updated.

Application Foregrounded 

When the mobile application comes to the foreground, an event is generated:

1{
2  "behaviorType": "AppLaunch",
3  "appName": "MyAppName",
4  "appVersion": "1.0.0",
5  "eventType": "appEvents",
6  "category": "Engagement",
7  // + all automatically assigned fields like deviceId, sessionId, dateTime, etc.
8}

On the first app launch, behaviorType is set to "AppFirstLaunch".

Note

Application Moves to the Background 

When the mobile application moves to the background, an event is generated,

1{
2  "behaviorType": "AppBackgrounded",
3  "appName": "MyAppName",
4  "appVersion": "1.0.0",
5  "eventType": "appEvents",
6  "category": "Engagement",
7  // + all automatically assigned fields like deviceId, sessionId, dateTime, etc.
8}

Application Version Changed 

When the mobile application is updated, an event is generated.

1{
2  "behaviorType": "AppUpdate",
3  "previousAppVersion": "1.0.0",
4  "appName": "MyAppName",
5  "appVersion": "1.2.3",
6  "eventType": "appEvents",
7  "category": "Engagement",
8  // + all automatically assigned fields like deviceId, sessionId, dateTime, etc.
9}

Screen Events 

Screen events track customer navigation patterns as they move through different screens and views within your mobile application.

Screen View 

Screen view events are generated when customers navigate through different screens in your app:

  • Android: When navigating through Activity views
  • iOS: When UIViewControllers are added to the view hierarchy
1{
2  "behaviorType": "ScreenView",
3  "screenName": "MyScreenName",
4  "appName": "MyAppName",
5  "appVersion": "1.0.0",
6  "eventType": "appEvents",
7  "category": "Engagement",
8  // + all automatically assigned fields like deviceId, sessionId, dateTime, etc.
9}

Send Behavior Data 

After you’ve configured the Data 360 Module and enabled the desired behavioral events, the SDK automatically sends these events to Data 360 as they occur in your app. No manual intervention is required.