• Live group demo of Marketing Hub + Data Agent

    Standardize reporting, reduce manual work, and introduce AI without cleanup

    Join us on March 12
  • Ready to build your local HubSpot community?

    HUG leaders host events, spark connections, and create spaces where people learn and grow together.

    Become a HUG Leader

Tracking code API

MW-at-mims
Participant

We have a problem with tracking a page view in Hubspot.

Our web pages are only tracked as <domain name>/[object Object] only, not with the proper full path. e.g. https://exampledomain.com/[object Object]

 

We are sending proper parameters as described in the tracking API page:

https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications 

 

However the API parameters [po] [rpo] are showing the value [object Object]. [rcu] shows the previous page URL path [pu] shows the current page URL path. How can we fix this issue?

0 Upvotes
1 Reply 1
Jaycee_Lewis
Thought Leader

Hey, @MW-at-mims 👋 Thanks for your question. I am not an expert in this area by any means. I did a little digging through other posts for suggestions. We'll also leave this post open in case other community members have any additional suggestions for you.

 

Here are a few troubleshooting steps and suggestions:

  • Inspect Network Requests: Use your browser’s developer tools to inspect the network requests being made to HubSpot. Check the payload being sent to ensure that the parameters are being passed as strings, not objects
  • Console Logs: Add console logs before sending the data to HubSpot to see how the `po` and `rpo` values are being formatted. This can help identify if they are objects or strings.

Summary:

Make sure you’re passing `po` and `rpo` as serialized strings, not objects. In the context of an SPA, use the `window._hsq.push()` method correctly to track page views on route changes, and ensure that `setPath` is using a string value for the new path.

 

If this doesn’t solve the issue or you need further assistance, feel free to share more details!

 

Have fun building! — Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes