Yes! BlueConic listeners and interactions will automatically trigger from hashchange/popstate events.
For the best results, be sure that the URL displayed in the address bar changes for the user and is representative of the content they are viewing. Though technically there is a single page view for the user, BlueConic will track each URL change as a new page view, enabling you to collect data based on the contents of the URL as well as the page.
How to verify
- Open your website in the BlueConic Simulator
- Click the "Clean Up" button to make sure you're working with a clean profile
- Examine the number of page views in your profile: after the cleanup, it should be "1".
- Now navigate your single page website while keeping an eye on the number of page views. The number should increase with every click.
BlueConic works with your single page website if the number correctly increases with every navigation move, as demonstrated in the video:
- Starting page:
https://www.blueconic.com/pricing/, page views: 1
- Navigating to regular page:
https://www.blueconic.com/what-am-i-getting, page views: 2
- Navigating to the single page app form (note: the URL changes)
https://www.blueconic.com/what-am-i-getting/#startfreenow, page views: 3
However, if certain navigation moves do not increase the number of page views, BlueConic appears to be missing the transition from one page to another. The most common reason for this is that the URL of the page does not change. Ask your web developer to make sure every page has a different URL and run the verification above again.
BlueConic is dependent on your single page application for notifications on page changes. There are a couple of events that can be picked up on:
- The hashchange event (fired when the URL after the "#" changes)
- The popstate event
- Calling history.pushState()
- Calling history.replaceState()
Not all single page applications are the same. So if you keep on having problems with the page views count, ask your developers which of the above events your single page application uses and contact us! We can likely help you out with a listener customized for your specific situation.