How do I install the Leadinfo tracking code for a Single Page Application (SPA)?

A Single Page Application (SPA) is a website that does not reload when someone visits your website. When you click through on the website, the page will not be reloaded. This is mostly used to improve the user experience.

Installing Leadinfo for a Single Page Application

First, you need to install the tracking code on your website. Take a look at these help articles that explain how you can install the tracking code.


Once you've installed the tracking code, Leadinfo will recognise every page as the home page on a SPA. To track individual pages for a single page application (such as React, AngularJS and other JavaScript pages) you need to add an extra code to the source code of the page.


You can add the below code to every page:

<script>
if(window.leadinfo) {
window.leadinfo("trackPageView");
}
</script>