How do I install the HubSpot tracking code on a WordPress site without the plugin?

Last updated: October 6, 2015

While it is recommended that you use the HubSpot Tracking Code for Wordpress plugin, you can alternatively install the tracking code manually. If you manually add the tracking code, HubSpot will not be able to differentiate posts versus pages in its reporting.

For websites hosted on

If your website is hosted on, you will not be able to add the HubSpot tracking code to your website. WordPress does not allow users to add any JavaScript code to sites because it is a shared environment.

For websites hosted on

Copy the HubSpot tracking code

  • Navigate to Reports > Reports Settings.
Reports Settings
Copy the tracking code to your clipboard.
Copy tracking code
Copy tracking code

Install the tracking code on your WordPress site

  • Log into your WordPress account, navigate to Appearance > Editor in the left sidebar.
Wordpress Editor
Click on the Footer (footer.php) file in the right sidebar.
Wordpress footer file
Paste your HubSpot tracking code immediately above the </body> tag.
Tracking Code in Wordpress
Click Update File.