Reports

How do I know if my HubSpot tracking code is working?

Last updated: mai 2, 2018

There are a few ways to verify that your tracking code is working. Click one of the examples below for instructions:

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

  1. Verify your HubSpot ID (Hub ID). Your Hub ID is located in the top right-hand corner of your HubSpot account.
  2.  Open a page on your website in your browser and right-click on the screen.
  3.  Select View page source or View source.
  4. The next screen will show all of the code that makes up your website. To find out 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 (for example, 401264.js).

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

    If you are using Google Tag Manager or another script loader, the tracking code will not appear in the page source. Follow the steps below to check the Network tab and ensure that the code is firing correctly.

View Page Source
  • If the tracking code is not found on your website, learn more about how to install HubSpot's tracking code.
  • If the tracking code is installed on your website, verify that the code has been copied and pasted correctly from your account settings under Install Code & Tracking.

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 on the screen.
  • Select Inspect Element (or Inspect). You will see a toolbar appear at the bottom of your screen.
  • Click on the Network tab, then refresh your page. Within the Network tab, you will now see the Name, Method, Status, Type, etc. for all of the elements loading on your webpage.
  • Click on the Name column to sort alphabetically, then scroll to the top of the list.
  • Look for [your Hub ID].js in the Name column; for example: 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 here.  


  • 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. Please contact HubSpot Support for further troubleshooting.

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 just see the actual tracking script (js.hs-analytics.net) and not the script loader, that is normal.

If you use the messages tool, 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 navigate to Reports > Analytics Tools, select Traffic Analytics and then click on the Pages tab. Select one of your external pages in the pages report by clicking the checkbox directly next to the domain. 

Select Today for the date range, and check to see if there are visits to your pages. If there are, that means that your tracking code is firing. If you are not seeing your pages, 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 visits 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 visits in the pages report, check out 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.