Plugin for Docusaurus to install the HubSpot Tracking code. Allowing HubSpot to monitor your Docusaurus site traffic.
The following script tag is inserted into the head tag
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/YOUR_HUB_ID.js"></script>
<!-- End of HubSpot Embed Code -->
Install the package using your preferred package manager
npm install --save docusaurus-plugin-hubspot
yarn add docusaurus-plugin-hubspot
pnpm add docusaurus-plugin-hubspot
Name | Type | Default | Description |
---|---|---|---|
hubId |
number |
Required | Hub ID identifies your company's account |
async |
boolean |
true |
sets the async attribute on the script tag |
defer |
boolean |
true |
sets the defer attribute on the script tag |
To configure the plugin add the plugins and options to docusaurus.config.js
{
plugins: [
[
'docusaurus-plugin-hubspot',
{
hubId: YOUR_HUB_ID,
async: true,
defer: true,
}
],
...
]
}
If you are experiencing issues refer to HubSpot Support article for "Troubleshoot the HubSpot tracking code."