<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tracking code API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Tracking-code-API/m-p/1041345#M76622</link>
    <description>&lt;P&gt;We have a problem with tracking a page view in Hubspot.&lt;/P&gt;&lt;P&gt;Our web pages are only tracked as &amp;lt;domain name&amp;gt;/[object Object] only,&amp;nbsp;not with the proper full path. e.g. &lt;A href="https://exampledomain.com/[object" target="_blank"&gt;https://exampledomain.com/[object&lt;/A&gt; Object]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are sending proper parameters as described in the tracking API page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications" target="_blank"&gt;https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 04:42:28 GMT</pubDate>
    <dc:creator>MW-at-mims</dc:creator>
    <dc:date>2024-09-16T04:42:28Z</dc:date>
    <item>
      <title>Tracking code API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Tracking-code-API/m-p/1041345#M76622</link>
      <description>&lt;P&gt;We have a problem with tracking a page view in Hubspot.&lt;/P&gt;&lt;P&gt;Our web pages are only tracked as &amp;lt;domain name&amp;gt;/[object Object] only,&amp;nbsp;not with the proper full path. e.g. &lt;A href="https://exampledomain.com/[object" target="_blank"&gt;https://exampledomain.com/[object&lt;/A&gt; Object]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are sending proper parameters as described in the tracking API page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications" target="_blank"&gt;https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 04:42:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Tracking-code-API/m-p/1041345#M76622</guid>
      <dc:creator>MW-at-mims</dc:creator>
      <dc:date>2024-09-16T04:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking code API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Tracking-code-API/m-p/1041601#M76636</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/222182"&gt;@MW-at-mims&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; 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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are a few troubleshooting steps and suggestions:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;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 &lt;STRONG&gt;strings, not objects&lt;/STRONG&gt;&lt;/LI&gt;
 &lt;LI&gt;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.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Summary:&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this doesn’t solve the issue or you need further assistance, feel free to share more details!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun building! — Jaycee&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 17:22:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Tracking-code-API/m-p/1041601#M76636</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-09-16T17:22:23Z</dc:date>
    </item>
  </channel>
</rss>

