Skip to main content

Page and screen views

Page and screen view events are important events for tracking the navigation within your app. Page views are tracked on Web and screen views on mobile.

Page view events

Page view tracking is used to record views of web pages.

Under the hood, the page view events are not self-describing events but standard events with the event type pv. The tracked information includes the page URL and title. You can see an overview of the page fields in the atomic events table here.

Additionally, the page view is assigned an identifier – the page view ID. This is tracked in the web_page context entity in that page view event and for all events on that page.

Context entity: web_page

Schema for a web page context

Schema URI:iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0

WebMobileTracked automatically
👀 Example
{
"id": "024629F0-6B9B-440C-82D4-DB3CF9D31533"
}
📃 Schema properties definition
PropertyTypeDescriptionRequired?
id"string"

How to track?

See the documentation for the JavaScript tracker to learn how to track a page view event.

Screen view events

Screen view events are the equivalent of the page view events for mobile apps. In contrast with page view events, screen view events are self-describing events.

Event: screen_view

Schema for a screen view event

Schema URI:iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0

WebMobileTracked automatically
Depends on the app framework
👀 Example
{
"name": "Screen 2",
"type": "feed",
"id": "024629F0-6B9B-440C-82D4-DB3CF9D31533",
"previousName": "Screen 1",
"previousId": "86ffd23c-b844-4ed4-aae9-7796b8b6f1e4",
"previousType": "feed",
"transitionType": "push"
}
📃 Schema properties definition
PropertyTypeDescriptionRequired?
name"string"The name of the screen viewed.
type"string"The type of screen that was viewed e.g feed / carousel.
id"string"An ID from the associated screenview event.
previousName"string"The name of the previous screen.
previousId"string"A screenview ID of the previous screenview.
previousType"string"The screen type of the previous screenview.
transitionType"string"The type of transition that led to the screen being viewed.
❓ How to query the event in the warehouse?
select
unstruct_event_com_snowplowanalytics_mobile_screen_view_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 = 'screen_view'
and events.event_vendor = 'com.snowplowanalytics.mobile'

After a screen view event is tracked, the tracker attaches a screen context entity to all the events tracked by the tracker reporting the last (and probably current) screen visible on device when the event was tracked.

Context entity: screen

Schema for a context that represents information pertaining to the current screen being viewed when an event occurs.

Schema URI:iglu:com.snowplowanalytics.mobile/screen/jsonschema/1-0-0

WebMobileTracked automatically
👀 Example
{
"name": "Screen 2",
"type": "feed",
"id": "024629F0-6B9B-440C-82D4-DB3CF9D31533"
}
📃 Schema properties definition
PropertyTypeDescriptionRequired?
name"string"The name of the screen viewed.
type"string"The type of screen that was viewed e.g feed / carousel.
id"string"An ID from the associated screenview event.
viewController"string"iOS specific: class name of the view controller.
topViewController"string"iOS specific: class name of the top level view controller.
activity"string"Android specific: name of activity.
fragment"string"Android specific: name of fragment.

How to track?

Use in modeling

Page and screen view events are used by our dbt packages to model web and mobile data. The Snowplow Web Package as well as the Snowplow Mobile Package use them to provided aggregated page and screen tables.