×

How Hupspot tracking code works

How to Check if Your Hubspot Tracking Code Is Working

Your Hubspot tracking code is the foundation of accurate analytics, contact tracking, and reporting. If it is not firing correctly, your dashboards, reports, and marketing automation will all be based on incomplete data. This guide walks you through practical ways to confirm that the tracking snippet is installed and sending data from your website to your Hubspot account.

What the Hubspot Tracking Code Does

Before you test, it helps to understand what the script actually handles on your pages. When installed correctly, the tracking code will:

  • Record page views and sessions for anonymous visitors and known contacts.
  • Associate page activity with forms and other conversion events.
  • Send data into your Hubspot analytics tools and standard reports.
  • Help power lists, workflows, and attribution reports based on page behavior.

If reports look empty, page views are missing, or sessions seem unusually low, your first step is to verify that the Hubspot tracking script is installed and running.

Where the Hubspot Tracking Code Should Be Installed

The tracking snippet must be present on every page where you want data collected. In most implementations, you or your developer will place the script in a shared layout or template so it automatically loads across the entire site.

Recommended placement:

  • Insert the tracking script before the closing </head> tag when possible.
  • If you use a content management system (CMS), add it to a global header or theme file.
  • On single landing pages or microsites, confirm the code is added to each standalone page.

Once the snippet is in place, you can run a few simple tests to confirm that Hubspot is receiving the data.

How to Verify the Hubspot Tracking Code in Your Browser

You can run a quick client-side check using your browser's developer tools. This confirms the tracking script loads on the page and attempts to contact the analytics servers.

Step 1: Open the page and your browser tools

  1. Open the web page where you added the script.
  2. Right-click anywhere on the page and select Inspect (name may vary by browser).
  3. In the panel that opens, switch to the Network tab.

Make sure the network panel is recording requests. If it is paused, press the record icon or refresh the page to reload all assets.

Step 2: Filter for the Hubspot tracking request

  1. In the Network tab, look for a search or filter field.
  2. Type part of the tracking URL or vendor domain associated with the Hubspot analytics script.
  3. Reload the page to capture fresh requests if nothing appears initially.

You should see a request related to the tracking script or tracking beacon. When the script is installed correctly, it will load without errors and respond with a valid status code, typically 200.

Step 3: Check for errors

Still in your browser tools, review the following:

  • Status code: Confirm the tracking request is not returning a 4xx or 5xx error.
  • Console tab: Look for JavaScript errors that could block the Hubspot tracking code from running.
  • Ad blockers: Temporarily disable browser extensions that might block analytics scripts.

If your browser shows that the script loads and runs without errors, your next check is inside the analytics tools in your account.

Confirm Hubspot Is Recording Page Views

Once you have confirmed that the script loads in the browser, make sure it actually records visits in your reporting tools. This ensures the data sent from your website is received and processed correctly.

Step 1: Visit a test page multiple times

  1. Open a test page that includes the tracking code.
  2. Refresh the page a few times or visit it from different browsers or devices.
  3. Wait a short period for the Hubspot analytics to process the activity.

Keep the URL of your test page handy; you will use it to look up performance in your account.

Step 2: Review analytics for the page

  1. Sign in to your account and go to your website or traffic analytics tools.
  2. Locate the report that lists individual pages or URLs.
  3. Search for your test page URL in the list.

In a working setup, you should see:

  • At least one page view or session attributed to that URL.
  • Recent timestamps that align with your test visits.
  • Basic engagement metrics such as views and entrances.

If the test page does not appear at all, or the numbers remain at zero after sufficient time, revisit the installation and browser tests to be sure the Hubspot tracking code is present and firing.

Troubleshooting Hubspot Tracking Issues

If data still does not appear in your reports after you verify the browser request, use the following checklist to diagnose common issues.

1. Check for multiple tracking snippets

Having more than one analytics snippet on the same page can create conflicts or overwrite cookies. Verify your templates and tag manager containers to ensure only a single instance of the Hubspot tracking code is active per page.

2. Confirm the correct account is used

Developers sometimes copy a tracking script from a test or legacy account. Make sure the tracking code on your live site matches the current account where you expect to see data. If you manage several portals, compare the account identifiers carefully.

3. Review cookie consent and privacy tools

Cookie banners and consent management platforms can block analytics collection until visitors approve tracking. If consent is denied or the script is delayed, your Hubspot reports may show fewer sessions than expected.

  • Check how your consent tool interacts with the tracking script.
  • Confirm that analytics cookies are allowed after consent.
  • Test with and without consent to see the impact on data collection.

4. Watch for SPA or dynamic site behavior

On single-page applications or heavy JavaScript frameworks, content changes without full page reloads. In these cases, you may need additional configuration to trigger tracking events on route changes so Hubspot records each view correctly.

5. Validate against another analytics tool

If you have another analytics platform installed, compare trends rather than exact numbers.

  • Look for similar traffic patterns over the same date range.
  • Check if both tools agree on large spikes or drops.
  • Investigate big discrepancies that may signal tracking issues.

Consistent patterns between systems suggest your Hubspot configuration is generally healthy, while major gaps warrant deeper investigation.

Using Official Hubspot Help Resources

For more technical detail directly from the vendor, you can review the official help documentation on confirming that your tracking is installed correctly. The article at this Hubspot help page provides step-by-step guidance, screenshots, and additional troubleshooting tips maintained by the product team.

When working on broader analytics strategy, tagging plans, or CRM integrations, it can be helpful to work with specialists who understand the full lifecycle from tracking to reporting. Agencies such as Consultevo offer support for implementation, auditing, and optimization around data collection.

Keeping Your Hubspot Data Reliable

Once you confirm your Hubspot tracking code is working, make a habit of periodic checks whenever you:

  • Launch a new website or redesign existing templates.
  • Change your CMS, theme, or tag manager configuration.
  • Add or remove major scripts that could affect page performance.
  • Update cookie consent or privacy tools.

By validating your installation early and revisiting it after key changes, you maintain accurate analytics, reliable reports, and consistent marketing automation behavior. A stable tracking setup ensures that every insight you pull from Hubspot is grounded in complete, trustworthy data.

Need Help With Hubspot?

If you want expert help building, automating, or scaling your Hubspot , work with ConsultEvo, a team who has a decade of Hubspot experience.

Scale Hubspot

“`

Verified by MonsterInsights
×

Expert Implementation

Struggling with this HubSpot setup?

Skip the DIY stress. Our certified experts will build and optimize this for you today.