Track Pageviews

To aggregate user behavior and engagement at the screen/page level, track page transitions by calling the trackPageview command.

window._uxa = window._uxa || [];
window._uxa.push(["trackPageview", "PAGE_TITLE_OR_URL"]);

The Tag logs a pageview event that identifies the new page with the page title that you provide.

Track pageviews differences (with vs without WebView mode)

Section titled Track pageviews differences (with vs without WebView mode)

Tracking Pageviews has different rules depending if the Tag is loaded in WebView mode or not.

trackPageview command differences

Section titled trackPageview command differences
Webview modeWeb context
The Tag will not generate any natural pageview, you have to manually track all your screens.The Tag will generate a natural pageview when loaded.
The value you set is the one that will be seen in the Contentsquare platform.The tag will prepend the value with the domain and append it with the query parameters.
If no value (second array element) is provided, no default value will be providedThe tag will set the path as default value

Note on pageview tracking in WebView mode

Section titled Note on pageview tracking in WebView mode

When set in WebView mode, the CS Tag will not trigger natural pageviews. If you rely on natural pageviews when the page is loaded from a web browser, make sure to use trackPageview as the page is fully loaded, as soon as possible.

To do so, use the following code to call the trackPageview API as the DOM is ready:

document.addEventListener("DOMContentLoaded", function() {
window._uxa = window._uxa || [];
window._uxa.push(["trackPageview", "PAGE_TITLE_OR_URL"]);
});