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
pagein 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 callpageonce per page load for the library to function.You may optionally call
pagemore 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:
| Argument | Type | Description |
|---|---|---|
nameoptional | String | Name of the page, for example "Login", "Signup", "Settings" |
propertiesoptional | Object | Free-form dictionary of properties for the page. |
optionsoptional | Object | Free-form dictionary of options. Note: If you don't pass a properties object, you should pass an empty object {} before options |
callbackoptional | Function | Function 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:
pathname→pathprotocolhostname→domainsearch→queryStringhash→fragmenthrefport
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.
