Application Lifecycle Tracking in Kotlin SDK Alpha

Learn about the application lifecycle events tracking in Kotlin SDK.

The RudderStack Kotlin SDK automatically tracks the following lifecycle events when you use the lifecycle tracking feature in your app:

  • Application Installed
  • Application Updated
  • Application Opened
  • Application Backgrounded
success
With the application lifecycle tracking feature, you can automatically capture user’s app usage behavior and get insights into their behaviour and app engagement patterns.

Manage lifecycle tracking

Note that the lifecycle tracking feature is enabled in the SDK by default. To turn it off, set trackApplicationLifecycleEvents to false in the Configuration object during the SDK initialization, as shown:

analytics = Analytics(
    configuration = Configuration(
        trackApplicationLifecycleEvents = false,
        writeKey = BuildConfig.WRITE_KEY,
        application = application,
        dataPlaneUrl = BuildConfig.DATA_PLANE_URL,
    )
)

Lifecycle events

This section covers the different application lifecycle events tracked by the SDK.

Application Installed

The Application Installed event is triggered when the user opens the app for the first time after installation.

The SDK also captures the following properties while tracking this event:

PropertyData typeDescription
versionStringApp’s version name.
buildLongApp’s build number.

Application Updated

The Application Updated event is triggered when the user opens the app for the first time after updating it.

The SDK also captures the following properties while tracking this event:

PropertyData typeDescription
versionStringApp’s version name.
buildLongApp’s build number.
previous_versionStringApp’s version name before the update.
buildLongApp’s build number before the update.

Application Opened

The Application Opened event is triggered when the user opens the app, either as a fresh launch or from the background.

The SDK also captures the following properties while tracking this event:

PropertyData typeDescription
versionStringApp’s current version name.

Note: This property is tracked only for a fresh app launch.
from_backgroundBooleanSet to true if the app was opened from the background, set to false otherwise.

Application Backgrounded

The Application Backgrounded event is triggered whenever the app is backgrounded. Note that this event does not contain any additional properties.



Questions? Contact us by email or on Slack