How to install the tracking code on a WordPress website

Last Updated: August 12, 2015

To install the HubSpot tracking code on a WordPress site, install the HubSpot Tracking Code for WordPress plugin, within your WordPress instance.

What does the plugin do?

  • Installs the HubSpot tracking code on your WordPress site.
  • Sets content type for filtering between pages and posts in the Page Performance tool.
The "HubSpot Tracking Code for WordPress" plugin replaces the "HubSpot for WordPress" plugin. Unlike the older plugin, this plugin does not include various deprecated features and improves the reliability of plugin. Forms and CTAs should now be embeded directly in the WordPress editor. WordPress no longer transmits meta information such as publish date, comment count to Page Performance. Also WordPress blog comment forms no longer create contacts.


  • Your website or blog must be using a install. Tracking code cannot be installed on sites, as they do not allow you to add plugins or Javascript.
  • You must have WordPress version 3.0 or higher installed on your sever (the latest version is recommended).
  • The wp_footer function included in your WordPress theme’s footer file (footer.php). This function is required for our tracking code to be installed on every page of your site.
  • You must be a WordPress admin to be able to install plugins for your site. If you are not the admin, you can forward these instructions to the person who manages your WordPress install.


Follow these instructions to install the HubSpot Tracking Code for WordPress plugin to begin tracking your WordPress site analytics in HubSpot.

Log in to your WordPress account

Log in to your WordPress instance. You can generally access the login screen by adding /wp-admin to your URL. 


Add new plugin

Hover over the Plugins menu item in the WordPress side menu and then click on the Add New option.

Add new plugin

Search for the HubSpot plugin

Type "HubSpot Tracking Code" into the search field and click the Search Plugins button to search for the HubSpot plugin.

Search plugins

Install the plugin

Click on the Install Now link to install the latest version of the HubSpot Tracking Code for WordPress plugin into your WordPress website.

Install plugin

Activate the plugin

Click the Activate Plugin link to activate the plugin for your WordPress website.

Activate plugin

You'll see a Plugin activated message to confirm that the plugin is active. Next you'll configure the plugin to work with your HubSpot account.


Edit plugin settings

Hover over the Settings menu item in the WordPress side menu and click the HubSpot Settings option.

HubSpot Settings

Enter your Hub ID

Enter your Hub ID and click Save Settings.

Save settings

Verify the tracking code

To verify that the tracking code is working, follow these steps