APIs & Integrations

Not applicable

Tracking page visits in Single Page Application

Hello,

Our website is a Single Page Application, therefore we track dynamic state change instead of simple pageview on page load.

I’ve added hubspot script to our website, that should dynamically track state changes (page view) and send identify user event with email, id, last and first name.

Even when I used setPath function (https://developers.hubspot.com/docs/methods/tracking_code_api/track_page_view), for some reason HubSpot shows page title instead of url. We have same page title through all our onboarding process, but different URLs for each step and its very important for us to track users on each step.

Please, help us to solve this problem.

Thanks.

0 Upvotes
3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Tracking page visits in Single Page Application

Hi @Mirielle,

It’s expected that the pages will appear in-app as a link with the page title for the label and the visited page as the URL. I can see that even though the links all show the same title, they navigate to the correct URLs. When using the Track Page View method, the title tracked will be the current value of document.title. You’ll need to update document.title before tracking the page view, or the URLs will all show the same page title.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Tracking page visits in Single Page Application

Hi @Mirielle,

Can you send me a link to a contact record in your portal that’s showing this behavior?

Not applicable

Tracking page visits in Single Page Application

https://app.hubspot.com/sales/3942058/contact/164051/?interaction=note

Just created a test account and went through a few steps of Onboarding, it shows Account Setup (page title) instead of path for all the steps

0 Upvotes