Certain forms and funnels are designed in a way that does not require loading or sending a new page view. This is often seen in single-page applications (SPAs). There are a few methods you can use to track the different steps of an SPA, such as artificial pageviews (APV), dynamic variables (dVar), or custom page events.
Artificial pageviews (APV)
A JavaScript instruction can be executed to send an APV via the trackPageview command. This command is useful when the page changes without provoking a full reload of the page. Each instance of an APV will increment the page number of the session, allowing you to separate the flow of a SPA and add the APV URLs to mappings for use in Page Comparator, Zoning, and Journey Analysis.
Common use cases include pop-up modals, AJAX loading, and SPA forms.
<script type="text/javascript">
window._uxa = window._uxa || [];
window._uxa.push(['trackPageview', <PATH_TO_SEND>]);
</script>
Full technical documentation: https://docs.contentsquare.com/en/web/artificial-pageviews/
Dynamic Variables (dvar)
Dynamic variables are extra pieces of information associated with a session. They are in the form of key:value pairs and can be used to categorize traffic. Dvars can be sent at any point during a session without needing to send a new pageview. Each pageview can store up to 40 unique dynamic variable keys (maximum of 512 characters). The value can be a whole number or a string, with a maximum length of 255 characters.
Common applications of dynamic variables include A/B testing, promotional pop-ups, and user interface enhancements.
<script type="text/javascript">
window._uxa = window._uxa || [];
window._uxa.push(["trackDynamicVariable", {key: my_key, value: my_value}]);
</script>
Custom Page Events
Custom page events are additional information on the session in the form of single values that can be used to segment sessions. Similar to dvars, custom page events can be sent at any time during a session. Custom pages events are used when we want to segment based on a specific visitor action or onload event.
Custom page events can also be linked to Event Triggered Replays (ETR). If you have less than 100% Session Replay capture rate, and are interested in viewing replays for a specific event, custom page events can be leveraged to do so.
Common use cases include Feedback surveys/VOC, pageview duration/load times, and various on-click events.
<script type="text/javascript">
window._uxa = window._uxa || [];
window._uxa.push(['trackPageEvent', eventName]);
</script>