Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.76 KB

File metadata and controls

65 lines (47 loc) · 1.76 KB

docusaurus-plugin-hubspot

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 -->

Installation

Install the package using your preferred package manager

npm

npm install --save docusaurus-plugin-hubspot

Yarn

yarn add docusaurus-plugin-hubspot

pnpm

pnpm add docusaurus-plugin-hubspot

Configuration

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

Example configuration

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,
      }
    ],
    ...
  ]
}

Troubleshooting

If you are experiencing issues refer to HubSpot Support article for "Troubleshoot the HubSpot tracking code."