We have a similar issue, we hope you can help with.
-We use AngularJS which is Single Page Application (SPA)
-Now in our SPA application the page never really reloads/refreshes the view.
-So we use the standard AngularJS handler which basically fires on each page load it’s called stateChangeSuccess
// Track a new page using setPath:
//var _hsq = window._hsq = window._hsq || ;
// Track the page view for the new page
-This works however there are a few problems:
- If the user lands on a page with a Form on it and submits the form the data is sent to HubSpot as we expect it to be. However, if the user navigates to another page the HubSpot code is not smart enough to rescan the HTML DOM and check if there is a Form it can submit is available. How do we force the Hubspot code to “reinitialise” essentially we want it to rescan the DOM as it would do on a normal HTML page reload. We assume it has something to do with the HS_CONTEXT but have no understanding on the method we can call to reinit. Could you give us some pointers?
How to customize the form embed code
This is a list of options that you can use if you just need to tweak a default hubspot form. If you need complete control over the styles and actions of your form, you will still want to use the Forms API.
Is there hbspt.forms.refresh() Or something equivalent?
If the user logs out how do we tell HubSpot that this is an anonymous user i.e. how should we call the “identify” method to tell HubSpot we have logged out?
The page track shows up in hubspot but seems to be one behind. For example
In hubspot PageB shows up instead of PageA and PageC shows up instead of PageB. We have tested this by putting the full URL in the tilte and we can see that we are sending the correct data. The api is somehow pushing it only on the secondary page.
This is duplicated and referenced: