Reports

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

Last updated: May 23, 2017

Available For:

Marketing: Free, Starter, Basic, Pro, Enterprise
Sales: Free, Professional

How to verify that the tracking code is installed correctly:

  1. Verify your HubSpot ID (Hub ID)If you do not know your Hub ID, navigate to your HubSpot Dashboard. Your Hub ID appears in the top right corner (in the navigation bar).
  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 corrently.

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 Reports > Reports Settings > Tracking Code.

How to verify that the tracking code 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.  

    If you do not know your Hub ID, navigate to your HubSpot account. Your Hub ID appears in the top right corner (in the navigation bar). 

  • 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.

Another way to determine whether or not your tracking code is firing correctly is to navigate to Reports Page Performance, and search for one of your external pages. Change the date range to display Today, 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 appear, 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.

How to determine why expected visits are not appearing on the Dashboard or in the Sources Report:

HubSpot's analytics update every 1-3 hours; data will not appear in your reports immediately. To see the last time that the analytics were updated, navigate to Reports > Sources.  Scroll to the bottom of the screen; you will see Data last updated: X hours ago. If it has been more than 3 hours since the analytics updated, visit status.hubspot.com to check if there is a known issue with HubSpot displaying analytics data.

Was this article helpful?