Skip to content

stackql/docusaurus-plugin-hubspot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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