The Page Spec

100% compatible with Segment

These specs are 100% compatible with http://segment.com specs.

Topics

The page call lets you record whenever a user sees a page of your website, along with any optional properties about the page.

Important Note:

  • When a name is provided in the page call, journy.io will collect those calls and stores them as (app) screen objects.

  • Without name, journy.io regards those calls as (website) page objects.

In analytics.js a page call is included in the snippet by default just after analytics.load. Many destinations require this page event to be fired at least once per page load for proper initialization. You may add an optional name or properties to the default call, or call it multiple times per page load if you have a single-page application.

Here’s the payload of a typical page call with most common fields

{ "type": "page", "name": "Home", "properties": { "title": "Welcome | Tesla", "url": "http://www.tesla.com" } }

And here’s the corresponding JavaScript event that would generate the above payload. If you’re using journy.io’s JavaScript library, the page URL are automatically gathered and passed as properties into the event payload:

analytics.page("Home");

Based on the library you use, the syntax in the examples might be different. You can find library-specific documentation on the page.Sources Overview

Beyond the common fields, the page call takes the following fields:

FIELD

REQUIRED?

TYPE

DESCRIPTION

category

optional

String

The category of the page, added to the properties object.
Passed as the first argument in a page call, for example analytics.page("category", "name");

name

optional

String

Name of the page For example, most sites have a “Signup” page that can be useful to tag, so you can see users as they move through your funnel.

properties

optional

Object

Free-form dictionary of properties of the page, like url and referrer

Tracking screen views on users AND accounts!

In B2B though, most app screen views are tracked on both user and account level. Indeed, when users can be part of different accounts, it is important to know in which account the user was active, when viewing the app screen.

In most B2B cases, the payload would look like this:

{ "type": "page", "userId": "abc123", // Elon Musk "name": "Dashboard", "properties": { "title": "Dashboard | Tesla", "url": "http://www.tesla.com/welcome" } "context": { "groupId" : "xyz789" } // Tesla, Inc }

In most B2B cases, the appropriate JavaScript would then be:

Example

Here’s a complete example of a page call:

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.

Properties

Properties are extra pieces of information that describe the page. They can be anything you want.

journy.io handles properties with semantic meanings in unique ways. For example, Segment always expects path to be a page’s URL path, and referrer to be the previous page’s URL.

You should only use reserved properties for their intended meaning.

Reserved properties journy.io has standardized:

PROPERTY

TYPE

DESCRIPTION

name

String

Name of the page. Reserved for future use.

path

String

Path portion of the page’s URL. Equivalent to canonical path which defaults to location.pathname from the DOM API.

referrer

String

Previous page’s full URL. Equivalent to document.referrer from the DOM API.

search

String

Query string portion of the page’s URL. Equivalent to location.search from the DOM API.

title

String

Page’s title. Equivalent to document.title from the DOM API.

url

String

Page’s full URL. Segment first looks for the canonical URL. If the canonical URL is not provided, journy.io uses location.href from the DOM API.

keywords

Array [String]

A list/array of keywords describing the page’s content. The keywords would most likely be the same as, or similar to, the keywords you would find in an HTML meta tag for SEO purposes. This property is mainly used by content publishers that rely heavily on pageview tracking. This isn’t automatically collected.

Note: In analytics.js, journy.io automatically sends the following properties: title, path, url, referrer, and search.