--- title: "Using The Page View API" slug: "using-the-page-view-api" updated: 2026-11-23T12:30:28Z published: 2026-11-23T12:30:28Z canonical: "support.gainsight.com/using-the-page-view-api" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # Using The Page View API This article explains the usage of the page view API. ## Overview Gainsight PX tracks page views automatically including when installed in SPA applications. Page View API allows for programmatically tracking virtual web pages for dynamic content or in applications that do not use routing. By default the PX track page view using document.title and document.location, it can be overridden using the following API: ```plaintext aptrinsic('pageView', [pageDetailsObj]) ``` The object can contain the following fields (none are required): | **Name** | **Type** | **Description** | | --- | --- | --- | | title | string | page title, this will allow to categories the page | | url | string | a full URL to track (if the protocol or domain will be missing the URL will be relative to the current document.location.href) | | path | string | path part of the URL, needs to start with a slash (\/) | Examples: ```plaintext aptrinsic("pageView", {"url" : "https://example.com/user"}); ``` Lets say the original URL is [https://examle.com/user/[userId]](https://examle.com/user/[userId]), and you do not want to track the user id on every page view. This way only the user path is tracked, alternatively you can call Aptrinsic page view with: ```plaintext aptrinsic("pageView", {"path" : "/user"}); ``` This way you only overrides the path portion on the URL Another example can be change the page title, lets say it is SPA and you want to identify dynamic content by title. You can change the title like: ```plaintext aptrinsic("pageView", {"title" : "update user details", "path" : "/userDetails"}); ``` This way if you had a popup with user details you can also track this action with title and a specific path. In this case only URL path and title will be overridden