Skip to content
  • There are no suggestions because the search field is empty.

How to install HubSpot Tracking code on a WordPress site

Installing the HubSpot tracking code on your website allows HubSpot to monitor your website.

Recommended Approach: Use the HubSpot WordPress Plugin

Requirements for Installing the Plugin

  1. WordPress Setup:
    • You must be using a WordPress.org install or have the WordPress.com Business Plan.
    • Note: Other WordPress.com plans (e.g., Premium, Personal) do not support plugins or JavaScript, so they are not compatible with the HubSpot plugin.
  2. WordPress Version:
    • Ensure your WordPress version matches the plugin's compatibility requirements. You can check this on the plugin page, located in the right sidebar under "WordPress Version."
  3. Admin Permissions:
    • You must have WordPress admin privileges to install the plugin.
    • Super admin rights are required to install plugins on multisite networks.
  4. Browser Settings:
    • Third-party cookies must be enabled in your browser.
    • Disable any browser add-ons or extensions that block third-party cookies before installing the plugin.

Follow these steps to install the HubSpot plugin directly from your WordPress admin dashboard:

  1. Log in to WordPress: Access your WordPress admin dashboard.
  2. Navigate to Plugins: In the left sidebar menu, go to Plugins > Add New.
  3. Search for HubSpot Plugin: In the search bar, type HubSpot All-In-One Marketing – Forms, Popups, Live Chat.
  4. Install the Plugin: In the search results, find the HubSpot plugin and click Install Now.
  5. Activate the Plugin: After installation, click Activate Plugin.

Manual Installation (If Plugin Cannot Be Used)

  1. Copy the HubSpot Tracking Code:

<!-- Start of HubSpot Embed Code -->

<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/45587478.js"></script>

<!-- End of HubSpot Embed Code -->

  1. Access WordPress: Log in to your WordPress admin dashboard.
  2. Navigate to Theme Editor: In the left sidebar, go to Appearance > Editor.
  3. Find and Edit the Footer: From the theme files listed on the right, choose Footer.
  4. Insert the Tracking Code: Paste the HubSpot tracking code just before the closing </body> tag.
  5. Update the Footer File: Click Update File to save changes.