Reports

Test your HubSpot tracking code

Last updated: October 23, 2018

free

I don't see any page views; is my tracking code installed correctly?

  1. Verify your HubSpot ID (Hub ID). Your Hub ID is located in the top-right corner of your HubSpot account.
  2. Open a page on your website in your browser and right-click anywhere on the page.
  3. In the dropdown menu, select View page source or View source.
  4. The next screen will show all of the HTML code on your website. To check if the HubSpot tracking code is installed, use the keyboard shortcut Ctrl + F or Cmd + F to bring up the search field. Search for [your Hub ID].js (e.g., 401264.js).

Please note: you may see the HubSpot Embed Code or Async HubSpot Analytics Code; these are both HubSpot tracking codes and indicate that your tracking code has been installed.

If you're using Google Tag Manager or another script loader, the tracking code will not appear in the page source. Instead, ensure that the tracking code is firing correctly.

View Page Source
  • If the tracking code is not found on your website, install the HubSpot tracking code.
  • If the tracking code is installed on your website, verify that the code has been copied and pasted correctly from your Reports & Analytics Tracking settings in your account settings.

I see the tracking code installed correctly on my website; how do I know if it is firing correctly?

  • Open a page on your website in your browser and right-click anywhere on the page.
  • In the dropdown menu, select Inspect Element (or Inspect). A toolbar will appear at the bottom or side of your screen.
  • Click the Network tab, then refresh your page. The Name, Method, Status, Type, etc. for all of the elements loading on your webpage will appear.
  • Click the Name column to sort the elements alphabetically, then scroll to the top of the list.
  • Look for [your Hub ID].js in the Name column (e.g.,401264.js). Under the name for the element, you may see from js.hs-scripts.com and/or an instance of this .js element from js.hs-analytics.com.


  • Next to [your Hub ID].js, you should see 304 Not Modified or 200 OK in the Status column.

If you see any other status or the .js code is not found, your tracking code may not be firing correctly. Contact HubSpot Support for further troubleshooting and assistance.

Please note: it is expected to see both hubid.js from js.hs-scripts.com and hubid.js from js.hs-analytics.net firing in the network tab. If the script loader (js.hs-scripts.com) is present, it is expected to also see the actual tracking script (js.hs-analytics.net).

If you only see the actual tracking script (js.hs-analytics.net) and not the script loader, this is normal.

If you use the conversations chat widget on your site, you might also see a third script entitled hubid.js from api.usemessages.com/messages, which is also normal.

Another way to determine whether or not your tracking code is firing correctly is to look at your website traffic in the traffic analytics report.

  • In your HubSpot account, navigate to Reports > Analytics Tools.
  • Select Traffic Analytics.
  • Click the Pages tab.
  • Select the checkbox next to the domain you're testing.

  • Select Today for the date range, and check to see if there is any traffic.
    • If there is traffic, your tracking code is firing.
    • If there is no traffic, it is likely that either the tracking code is not installed correctly or the pages have not had tracked views in the time range selected.

I don't see any page views today (but I did yesterday); is my tracking code working?

If it has been more than 20 minutes since your test session on your tracked website and you are not seeing expected page views in the pages report, check status.hubspot.com to see if there is a known issue with HubSpot displaying analytics data.

Was this article helpful?

If you still need help you can get answers from the , or to contact support.