curl --request POST \
--url https://js.hs-scripts.com/setPath \
--header 'Content-Type: application/javascript' \
--data @- <<EOF
"_hsq.push(['setPath', '/about-us']);"
EOFSet the path for tracking in single-page applications. Use before calling trackPageView to track the correct page.
curl --request POST \
--url https://js.hs-scripts.com/setPath \
--header 'Content-Type: application/javascript' \
--data @- <<EOF
"_hsq.push(['setPath', '/about-us']);"
EOFtrackPageView to track the correct page.
var _hsq = (window._hsq = window._hsq || []);
_hsq.push(["setPath", "/about-us"]);
<!-- Set up the path for the initial page view -->
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', '/home']);
</script>
<!-- Load the HubSpot tracking code -->
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/{hubId}.js"></script>
<!-- End of HubSpot Embed Code -->
<!-- Tracking subsequent page views -->
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', '/about-us']);
_hsq.push(['trackPageView']);
</script>
setPath before trackPageView to ensure accurate tracking/)Path data
The path to set for tracking
Path set successfully
Was this page helpful?