Can't see page views

Hello team,

Just wanted to check with you on the HubSpot integration. So, I’ve added the following code to our website header. The website is deployed here: https://kk2.aiurlabs.com/ If you inspect you can see the console logs triggered and the _hsq with a push method on it.

Where should we see the views? I’m looking at reports/analytics/traffic analytics and nothing appears.

We have tried different tracking codes aslo. We offer the website publishing to our customers and they can’t see the views either.

Could you please give us some hints?

Thanks

The website is a SPA.

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js-eu1.hs-scripts.com/139566652.js"></script>
<!-- End of HubSpot Embed Code -->

<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', { path: document.location.href }])
_hsq.push(['trackPageView']);

console.log('_hsq is', _hsq)

var oldHref = document.location.href;
window.onload = function() {
 var bodyList = document.querySelector("body")

 var observer = new MutationObserver(function(mutations) {
 mutations.forEach(function(mutation) {
 if (oldHref != document.location.href) {
 oldHref = document.location.href;
 /* Changed ! your code here */
 var _hsq = window._hsq = window._hsq || [];
 _hsq.push(['setPath', { path: document.location.href }])
 _hsq.push(['trackPageView']);
 console.log('should push to _hsq', document.location.href, '_hsq is', _hsq)
 }
 });
 });

 var config = {
 childList: true,
 subtree: true
 };

 observer.observe(bodyList, config);
};
</script>

Console view:

LE. When I go to Reports/ Analytics tools / Traffic analytics and click on Pages,

it says it has no data, and the only thing that I see is 2 pages below.

The first page changes if I navigate to some other page, but that’s it.

In the reports, I have no data.

Some updates, we managed to reload the scrips on every page change and just leave the following:

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js-eu1.hs-scripts.com/139566652.js"></script>
<!-- End of HubSpot Embed Code -->

<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', { path: document.location.href }])
_hsq.push(['trackPageView']);

console.log('_hsq is', _hsq)
console.log('should push ', document.location.href)
</script>

I see that the reports data appears a day after, and not in real time. It worked with the observer also.

My only question is the following: why does the page link appear like `url/[object Object]`, since I’m pushing the document.location.href?