Spec: Screen
The Screen call lets you record whenever a user sees a screen, the mobile equivalent of Page, in your mobile app, along with any properties about the screen. Calling Page or Screen in one of Segment’s sources is one of the first steps to getting started with Segment.
Here’s the payload of a typical Screen call, with most common fields removed:
{
"type": "screen",
"name": "Home",
"properties": {
"Feed Type": "private"
}
}
And here’s the corresponding Objective-C event that would generate the above payload:
[[SEGAnalytics sharedAnalytics] screen:@"Home"
properties:@{ @"Feed Type": @"private" }];
Based on the library you use, the syntax in the examples might be different. You can find library-specific documentation on the Sources Overview page.
Beyond the common fields, the Screen call takes the following fields:
Field | Type | Description | |
---|---|---|---|
name |
optional | String | Name of the screen See the Name field docs for more details. |
properties |
optional | Object | Free-form dictionary of properties of the screen, like name
See the Properties field docs for a list of reserved property names.
|
Example
Here’s a complete example of a Screen call:
{
"anonymousId": "3a12eab0-bca7-11e4-8dfc-aa07a5b093db",
"channel": "mobile",
"context": {
"ip": "8.8.8.8"
},
"integrations": {
"All": true,
"Mixpanel": false,
"Salesforce": false
},
"messageId": "022bb90c-bbac-11e4-8dfc-aa07a5b093db",
"name": "Home",
"properties": {
"variation": "blue signup button"
},
"receivedAt": "2015-02-23T22:28:55.387Z",
"sentAt": "2015-02-23T22:28:55.111Z",
"timestamp": "2015-02-23T22:28:55.111Z",
"type": "screen",
"userId": "97980cfea0067",
"version": "1.1"
}
Create your own Screen call
Use the following interactive code pen to see what your Screen calls would look like with user-provided information:
Sample Screen
Sample Screen Call
Sample output goes here!
Identities
The User ID is a unique identifier for the user performing the actions. Check out the User ID docs for more detail.
The Anonymous ID can be any pseudo-unique identifier, for cases where you don’t know who the user is, but you still want to tie them to an event. Check out the Anonymous ID docs for more detail.
Note: In our browser and mobile libraries a User ID is automatically added from the state stored by a previous identify
call, so you do not need to add it yourself. They will also automatically handle Anonymous IDs under the covers.
Name
Each screen can be tagged with a name
. For example, many apps have a “Signup” screen that can be useful to tag so that you can see users as they move through your funnel.
Properties
Properties are extra pieces of information that describe the screen. They can be anything you want.
Segment has reserved some properties with semantic meanings and handles them in special ways. You should only use reserved properties for their intended meaning.
Reserved properties that Segment has standardized:
Property | Type | Description |
---|---|---|
name |
String | Name of the screen. This is reserved for future use. |
This page was last modified: 21 Nov 2023
Need support?
Questions? Problems? Need more info? Contact Segment Support for assistance!