Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Native Mobile Spec


One of the core components of the Segment Spec is the Track method. It records any arbitrary event that the user has triggered. For Mobile tracking, in addition to Screen calls, you'll want to send specific event names that Segment recognizes semantically. That way, Segment can transform them correctly before sending them off to downstream destinations.

By standardizing the events that comprise the core mobile application lifecycle and associated mobile campaign and referral events, Segment and its partners can, wherever possible, forward these events on your behalf and build downstream destinations that take full advantage of the semantic meaning associated with these events and their properties.

(information)

Info

If you're already collecting similar events, Segment recommends migrating to these event names so that you can take advantage of available features in Segment destinations that depend on the spec as they become available.

These events also work with Segment's ecommerce spec for mobile marketplaces to take full advantage of features like dynamic ads in Facebook and the ability to take full advantage of server-side destinations with Mobile Attribution Platforms like Tune(link takes you to an external page) and Kochava(link takes you to an external page).

(information)

Info

Per the Privacy Policy(link takes you to an external page) and applicable terms, don't send Segment sensitive personal information about your users. Certain features from Segment and its partners allow you to opt-in to automatically track data (for example, Application Installed or Deep Link Clicked). When working with these features and Segment in general, be cognizant of the data that is being tracked to ensure its matching both your obligations under your agreement with Segment and the privacy expectations of your users.


Overview of events

overview-of-events page anchor

The Segment Native Mobile Spec includes the following semantic events:

Application Lifecycle Events

Campaign Events

Segment recommends using the above event names if you're going to be integrating the events yourself. This will ensure that they can be mapped effectively in downstream tools.


Mobile applications live within a fairly bounded lifecycle. To understand and communicate effectively with your users, it's crucial to instrument the core flows associated with installing and opening your app. The following events allow you to get a picture of top-line metrics such as DAUs, MAUs, and Screen Views per session. Automatic lifecycle event tracking is optional - you can learn how to enable and disable them in Segment's docs for each library below:

The following events will be tracked automatically when lifecycle events are enabled in all mobile libraries:

In Kotlin, Swift, and React Native, the following additional events are tracked:

In Swift, the following event is also tracked:

Application Installed

application-installed page anchor

This event fires when a user first opens your mobile application. If the user never opens your app after installing, Segment will not collect this event. This event doesn't wait for attribution or campaign information to be received, and is collected automatically by Segment's SDKs. Advertising providers like Facebook and Google require discrete install events to correctly attribute installs to ads served through their platform.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Installed",
5
"properties": {
6
"version": "1.2.3", "build": "1234"
7
}
8
}
PropertyTypeDescription
versionStringThe version installed.
buildStringThe build number of the installed app.

This event fires when a user launches or foregrounds your mobile application after the first open. It will fire after the Application Installed event and again after the app is re-opened after being closed. This event does not wait for attribution information to be received, but may include information about referring applications or deep link URLs if available to the application upon open.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Opened",
5
"properties": {
6
"from_background": false,
7
"referring_application": "GMail",
8
"url": "url://location"
9
}
10
}
PropertyTypeDescription
from_backgroundBooleanIf application transitioned(link takes you to an external page) from "Background" to "Inactive" state prior to foregrounding (as opposed to from "Not Running" state).
urlStringThe value of UIApplicationLaunchOptionsURLKey from launchOptions. Collected on iOS only.
referring_applicationStringThe value of UIApplicationLaunchOptionsSourceApplicationKey from launchOptions.
versionStringThe version installed.
buildStringThe build number of the installed app.

Application Backgrounded

application-backgrounded page anchor

This event should be sent when a user backgrounds the application upon applicationDidEnterBackground(link takes you to an external page).

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Backgrounded",
5
"properties": {}
6
}

Application Foregrounded

application-foregrounded page anchor

This event is fired when a user opens the app or brings it back into the foreground of their device. This is only collected by the Swift library.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Foregrounded",
5
"properties": {}
6
}

This event fires when a user updates the application. Segment's SDK will automatically collect this event instead of an "Application Opened" event when we determine that the Open is first since an update.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Updated",
5
"properties": {
6
"previous_version": "1.1.2",
7
"previous_build": "1234",
8
"version": "1.2.0",
9
"build": "1456"
10
}
11
}
PropertyTypeDescription
previous_versionStringThe previously recorded version.
previous_buildStringThe previously recorded build.
versionStringThe new version.
buildStringThe new build.

Fire this event when a user uninstalls the application. Some destination partners will detect this for you using Silent Push Notifications through their SDK. Visit the documentation for your destination to see if this is available. If supported, you might be able to send these events to Segment using a callback.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Uninstalled",
5
"properties": {}
6
}

You can send this event when you receive a crash notification from your app, but it is not meant to replace traditional crash reporting tools. By tracking crashes as an analytics event with device and user information, you can analyze the which types of users are impacted by crashes and how those crashes, in turn, affect their engagement. You may also want to target those customers with tailored communications in other channels if they've encountered several crashes. Segment does not collect this event. To capture the event, use a destination that collects this data and route that event back to Segment through a webhook or other callback.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Application Crashed",
5
"properties": {}
6
}

As the walls between apps become increasingly lowered, capturing information about the content and campaigns that drive users to engage with your app is critical to building more targeted, relevant, personalized experiences for your users.

Segment does not collect any campaign events automatically unless configured to do so.

When Segment or an integrated partner can discern the source of an install, we'll collect an Install Attributed event. This event may be sent to Segment using server-to-server connection from your attribution provider, or directly on the device using packaged destinations. In either case, this will happen after install, and does not apply to all installs, which is why it is a discrete event.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Install Attributed",
5
"properties": {
6
"provider": "Tune/Kochava/Branch/AppsFlyer",
7
"campaign": {
8
"source": "Network/FB/AdWords/MoPub/Source",
9
"name": "Campaign Name",
10
"content": "Organic Content Title",
11
"ad_creative": "Red Hello World Ad",
12
"ad_group": "Red Ones"
13
}
14
}
15
}
PropertyTypeDescription
providerStringThe attribution provider.
campaign[source]StringCampaign source — attributed ad network.
campaign[name]StringThe name of the attributed campaign.
campaign[medium]StringIdentifies what type of link was used.
campaign[content]StringThe content of the campaign.
campaign[ad_creative]StringThe ad creative name.
campaign[ad_group]StringThe ad group name.

Push Notification Received

push-notification-received page anchor

This event can be sent when a push notification is received in the app. It can be automatically enabled on iOS.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Push Notification Received",
5
"properties": {
6
"campaign": {
7
"medium": "Push",
8
"source": "Vendor Name",
9
"name": "Referral Flow",
10
"content": "Your friend invited you to play a match."
11
}
12
}
13
}
PropertyTypeDescription
campaign[name]StringCampaign name.
campaign[medium]StringIdentifies what type of link was used (Push Notification).
campaign[content]StringPush notification content.
campaign[source]StringDesignates the push provider. (Optional)

Push Notification Tapped

push-notification-tapped page anchor

This event can be sent when a user taps on a push notification associated with your app. It can be automatically enabled on iOS.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event": "Push Notification Tapped",
5
"properties": {
6
"action": "Accept",
7
"campaign": {
8
"medium": "Push",
9
"source": "Vendor Name",
10
"name": "Referral Flow",
11
"content": "Your friend invited you to play a match."
12
}
13
}
14
}
PropertyTypeDescription
actionStringIf this notification is "actionable", the custom action tapped. Default: "Open"
campaign[name]StringCampaign name.
campaign[medium]StringIdentifies what type of link was used (Push Notification).
campaign[content]StringPush notification content.
campaign[source]StringDesignates the push provider. (Optional)

Push Notification Bounced

push-notification-bounced page anchor

This event fires when a push notification from a provider bounces. If your push notification provider forwards push lifecycle events to Segment, they should include this event in their suite.

1
{
2
"userId": "019mr8mf4r",
3
"type": "track",
4
"event":"Push Notification Bounced",
5
"properties": {
6
"action": "Accept",
7
"campaign": {
8
"medium": "Push",
9
"source": "Vendor Name",
10
"name": "Referral Flow",
11
"content": "Your friend invited you to play a match."
12
}
13
}
14
}
PropertyTypeDescription
actionStringIf this notification is "actionable", the custom action tapped. Default: "Open"
campaign[name]StringCampaign name.
campaign[medium]StringIdentifies what type of link was used (Push Notification).
campaign[content]StringPush notification content.
campaign[source]StringDesignates the push provider. (Optional)