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
- 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.
- 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."
- Admin Permissions:
- You must have WordPress admin privileges to install the plugin.
- Super admin rights are required to install plugins on multisite networks.
- 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:
- Log in to WordPress: Access your WordPress admin dashboard.
- Navigate to Plugins: In the left sidebar menu, go to Plugins > Add New.
- Search for HubSpot Plugin: In the search bar, type HubSpot All-In-One Marketing – Forms, Popups, Live Chat.
- Install the Plugin: In the search results, find the HubSpot plugin and click Install Now.
- Activate the Plugin: After installation, click Activate Plugin.
Manual Installation (If Plugin Cannot Be Used)
- 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 -->
- Access WordPress: Log in to your WordPress admin dashboard.
- Navigate to Theme Editor: In the left sidebar, go to Appearance > Editor.
- Find and Edit the Footer: From the theme files listed on the right, choose Footer.
- Insert the Tracking Code: Paste the HubSpot tracking code just before the closing </body> tag.
- Update the Footer File: Click Update File to save changes.