HubSpot not tracking page views



We've installed the script underneath on this site: , but HubSpot doesn't recognize page views on a contacts contact record after visiting the URL above. We've tried with both already identified contacts in HubSpot, as well as new ones.

....the reason why we are using this tracking script is because the URL I'm referring to above is static even though you can visit multiple pages (and we would like to know which page was visited under the same URL).

We've done som minor debugging, but would really appreciate your assistance in order to solve this issue.

Thank you!


Hi @Andersh92,

There are a number of factors here that can all contribute to a contact being tracked / not being tracked. Can you give me some more information? It looks like theHubSpot tracking code is installed on this page, but are you using the identify and/or setPath methods of the tracking Code API? Can you give me an example contact that should be tracked, but isn't?


Hi @Derek_Gervais,

Thanks for getting back to me.

I know that setPath is being used, but am unsure of "Identify"
Here's two contacts that should be tracked, but isn't:



Hi @Andersh92,

Ok so a couple things jump out at me. First, that first contact looks like it's being filtered from your analytics based on it's IP address. If you've filtered your own IP addresses in reports settings, then any testing you do from your office might be flawed since analytics info will be excluded. I'd recommend using a VPN if you're testing analytics functionality.

The other thing I noticed is that it looks like the initial page view is registering (specifically for the second contact) but that's it; I'm not seeing and subsequent page views. This could mean that you're correctly using the setPath method, but you're not explicitly calling the trackPageView method afterwards. Both methods are necessary in single page apps; the setPath method changes the 'path' in the tracking code, and the trackPageView methods actually registers another page view without refreshing the page.


Hi @Derek_Gervais,

Thank you.

I know - the first contact is filtered from analytics, but he wasn't at the time he checked if the page views got registered on his contact record.

Anyway, let's stick to contact number two as our working example going forward. You say it looks like the initial page view is registering, do you see this on the contact record? Because I can't find anything on his record in HubSpot saying he visited . I will ask the clients developer if they're explicitly call the trackPageView afterwards, and let you know his response.

Thank you!


Hello again @Derek_Gervais,

Here's the answer from the developer to your question regarding trackPageView:

«I can confirm I am using trackPageView method as shown in the attached image. Though the methods will be called after a delay of 2 seconds. Have they taken it into account?»

Please find attached screenshot as well.

What do you think?



Hi @Andersh92,

I went ahead and did some testing on your site, and it doesn't appear that the form submission on the page you linked to ( actually creates a contact in HubSpot. If that form doesn't submit to HubSpot and include the hubspotutk parameter, the visit information won't automatically associate with contacts visiting that page. This is especially true for existing contacts that were created on your core website ( since the hubspotutk values are different between different domains. I was able to get the tracking to work by manually making an identify call (e.g. _hsq.push(["identify".{email:"}]);).

I'd recommend making sure that the tracking cookie on your heroku app is associated with the HubSpot contact somehow. You should consider doing one or more of the following:

  1. Add your app's domain to the 'Additional site domains' section of your tracking settings
  2. Make sure that your app associates the visitor's tracking code with their contact record. You can either:
    1. Submit the form to HubSpot via the forms API and include the hubspotuk parameter
    2. Make an identify call with the contact's email address (see below).

Let me know if you have any other questions that I can help with!


Hi @Derek_Gervais,

Thank you so much. I'll forward this to the developer, and I will let you know if we have any other questions :slight_smile: