page

Track pages visited by your users.

The page call lets you track any page visited by your users.

For example, a new user may visit your "Signup" page, which you could track as follows:

Sift.page('Signup');

📘

Calling page on every page load

We automatically call page in the JavaScript snippet you used to install Sift on your site so that a page is tracked immediately after your page has loaded. You must call page once per page load for the library to function.

You may optionally call page more than once per full page load, for example in single page web apps.

page method definition

Sift.page([name], [properties], [options], [callback]);

The page call accepts the following arguments:

ArgumentTypeDescription
name
optional
StringName of the page, for example "Login", "Signup", "Settings"
properties
optional
ObjectFree-form dictionary of properties for the page.
options
optional
ObjectFree-form dictionary of options.
Note: If you don't pass a properties object, you should pass an empty object {} before options
callback
optional
FunctionFunction executed after a brief timeout (allowing the browser time to make requests).

We automatically track the following properties of document.location and rename them as follows:

  • pathnamepath
  • protocol
  • hostnamedomain
  • searchqueryString
  • hashfragment
  • href
  • port
800

The URL we track defaults to your canonical URL first and falls back to location.href.

The page's name property uses document.title as a fallback.