Support Center
v1.0
English
Hubspot
To add Hubspot Analytics integration to DeveloperHub, you must have a plan with Custom HEAD Tags enabled.

Setting up Hubspot Analytics
Follow the steps as provided in Install the HubSpot tracking code. However, make sure to remove defer and async from the script tag.
The script should look like:
<script type="text/javascript" id="hs-script-loader" src="//js.hs-scripts.com/{{your-id}}.js"></script>
HubSpot Analytics integration is created for traditional websites, while your DeveloperHub documentation is built over a single page application. To trigger tracking page views, add the following Custom HEAD Tag after the embed code above:
<script>
var trackPage = function(event) {
var _hsq = window._hsq;
if (!_hsq) {
console.log('hsq not loaded yet');
return;
}
_hsq.push(['setPath', window.location.pathname]);
_hsq.push(['trackPageView']);
}
document.addEventListener('onsectionchange', trackPage);
document.addEventListener('onpagechange', trackPage);
</script>
Last updated by Zaid Daba'een on Nov 9, 2021
Was this page helpful?
Need help? Visit our community forums or contact us.
Getting Started
Publishing & Hosting
Access & Audiences
Search & Insights