Skip to main content

Mobile app install and lifecycle events

Mobile app usage lifecycle consists of several events that are important to understand how a user uses an app. These are the app install, foreground, and background events.

The app install event is tracked the first time the app is opened after installation. The background and foreground events are tracked when the user moves the app to background and foreground (the app becomes visible on the screen again). These events can be tracked automatically by our mobile trackers if configured to do so. Additionaly, the tracker attaches a LifecycleEntity to all the events tracked by the tracker reporting if the app was visible (foreground state) when the event was tracked.

note

It is not possible to track an event when an app is uninstalled since the mobile platforms do not provide a callback where such an event could be tracked.

Install event

application_install

Event
Schema for an event where a mobile application is installed.
Schema URIiglu:com.snowplowanalytics.mobile/application_install/jsonschema/1-0-0
Tracker compatibility
Web: Mobile: Tracked automatically:
Example
{}
Schema
PropertyDescription
Warehouse query
select
unstruct_event_com_snowplowanalytics_mobile_application_install_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'application_install'
and events.event_vendor = 'com.snowplowanalytics.mobile'

Android referrer details context entity

On Android, an extra context entity with install referrer information can be attached to the install event. It makes use of the Google Play Install Referrer library to retrieve the referrer information.

referrer_details

Event
Represents an install referrer details for Android apps installed from the Play Store (see https://developer.android.com/reference/com/android/installreferrer/api/ReferrerDetails)
Schema URIiglu:com.android.installreferrer.api/referrer_details/jsonschema/1-0-0
Tracker compatibility
Web: Mobile: Tracked automatically:
Example
{
"installReferrer": "https://play.google.com/store/apps/details?id=com.example.myapp&referrer=someid%3Dsomedata",
"referrerClickTimestamp": "2023-11-03T09:55:29.920Z",
"installBeginTimestamp": "2023-11-03T10:55:29.920Z",
"googlePlayInstantParam": true
}
Schema
PropertyDescription
installReferrer
string
Optional. The referrer URL of the installed package
referrerClickTimestamp
string
Optional. The timestamp when referrer click happens
installBeginTimestamp
string
Optional. The timestamp when installation begins
googlePlayInstantParam
boolean
Required. Boolean indicating if the user has interacted with the app's instant experience in the past 7 days
Warehouse query
select
unstruct_event_com_android_installreferrer_api_referrer_details_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'referrer_details'
and events.event_vendor = 'com.android.installreferrer.api'

How to track?

See the documentation for the Android tracker for more information how to track the entity.

Foreground event

application_foreground

Event
Schema for an application foreground event
Schema URIiglu:com.snowplowanalytics.snowplow/application_foreground/jsonschema/1-0-0
Tracker compatibility
Web: Mobile: Tracked automatically:
Example
{
"foregroundIndex": 1
}
Schema
PropertyDescription
foregroundIndex
integer
Optional.
Warehouse query
select
unstruct_event_com_snowplowanalytics_snowplow_application_foreground_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'application_foreground'
and events.event_vendor = 'com.snowplowanalytics.snowplow'

Background event

application_background

Event
Schema for an application background event
Schema URIiglu:com.snowplowanalytics.snowplow/application_background/jsonschema/1-0-0
Tracker compatibility
Web: Mobile: Tracked automatically:
Example
{
"backgroundIndex": 1
}
Schema
PropertyDescription
backgroundIndex
integer
Optional.
Warehouse query
select
unstruct_event_com_snowplowanalytics_snowplow_application_background_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'application_background'
and events.event_vendor = 'com.snowplowanalytics.snowplow'

Lifecycle context entity

application_lifecycle

Entity
Entity that indicates the visibility state of the app (foreground, background)
Schema URIiglu:com.snowplowanalytics.mobile/application_lifecycle/jsonschema/1-0-0
Tracker compatibility
Web: Mobile: Tracked automatically:
Example
{
"isVisible": true,
"index": 2
}
Schema
PropertyDescription
isVisible
boolean
Required. Indicates if the app is in foreground state (true) or background state (false)
index
integer
Optional. Represents the foreground index or background index (tracked with com.snowplowanalytics.snowplow application_foreground and application_background events.

How to track?