Single Page Applications (SPAs) allow your users to browse different pages on your site without having to reload the page completely. In most cases, a SPA website will change the URL in the browser, even though the page is not being reloaded.
By default, Hotjar is able to detect and track these SPA URL changes automatically. If a user visits a new page on your SPA site and the URL doesn't change, or fragments are added to the URL that need to be tracked by Hotjar, then you may need to update your Hotjar settings to ensure that Hotjar will correctly track page state changes.
Below are the three URL tracking options that we have available:
- Track changes automatically, excluding fragments (default)
- Track changes automatically, including fragments
- Track changes manually
For more information on each of these options, check out our article: Hotjar Settings for URL Changes
The steps outlined below show how you can update the 'Tracking URL' settings.
Click on Settings, then Sites & Organizations from the Hotjar Dashboard.
Click the settings cog to open the Site Settings for the Site you would like to change.
Under Session Targeting and Tracking, select the tracking option that works best for your site.
If you are unsure of which tracking options work best for your site, take a look at Hotjar Settings for URL Changes for help.