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.