Exclude subdomain from analytics

Hi there!

Our domain has several subdomains. Some of them are external, and some of them are internal and should not be tracked. Is there a way to exclude some of the subdomains from HubSpot analytics and reporting so we can have more accurate numbers on our dashboards? I’ve tried identifying an IP address for the subdomains I want to exclude, but I’m not having much luck. Appreciate your thoughts and expertise!

Yes, it is possible to exclude certain subdomains from being tracked by HubSpot analytics and reporting. Here are the steps you can follow to do so:

  1. In your HubSpot account, go to the Reports dashboard.
  2. Click the gear icon in the top right corner and select “Edit tracking code.”
  3. Scroll down to the “Exclude certain subdomains from tracking” section.
  4. Enter the subdomains you want to exclude, separated by a comma. For example, if you want to exclude subdomains “test” and “dev,” you would enter “test,dev” in this field.
  5. Click “Save.”

Note that this will only exclude subdomains from being tracked by HubSpot. If you want to exclude them from being tracked by other analytics tools, you will need to follow the instructions for those specific tools.

I hope this helps! Let me know if you have any other questions.


Thanks for your help, daithi! I apologize since I’m having trouble following your instructions. When you say the gear in the top right corner, do you mean the one on the main Hubspot navigation, pictured here? I don’t see any other gears, and I checked on a Super admin account. When I click the gear in the top right, as pictured, I’m not finding anything that says “Edit tracking code” once I click that gear. I know there’s a tracking code under ‘Tracking & Analytics’ but I don’t see anything about subdomains. We’re using the Marketing Hub professional if that helps at all. Thanks again for your help. Any clarity you could provide on what I’m missing would be greatly appreciated!

This sounds like it was written by ChatGPT.

Wanted to provide an update on this. HubSpot support has confirmed there isn’t a way to completely exclude specific subdomains from analytics and tracking if those subdomains are hosted in Hubspot. There are filters available on a few reports that will help exclude that traffic, but there aren’t many. Appreciate everyone’s help and hope Hubspot will make this option available to us in the future.

I have not been able to accomplish this, and I really need to figure out how I can filter out two subdomains, but keep the traffic from others (www, blog, learn, web). I don’t want to modify the tracking code so I can never track a subdomain, but I want to be able to filter our app.domain from reports showing our traffic to other, more marketing focused domains.
Need help. @SVoge

Hi @donrua, I hope that you are well!
Thanks for reaching out to the HubSpot Community!
I can see on this article “Exclude traffic from your site analytics” that it is stated that:
“It is not possible to block a domain that is included as a site domain. For example, if the root domain hubspot.com is included as a site domain, then, app.hubspot.com cannot be excluded. If the site domain were a subdomain such as www.hubspot.com instead of the root domain, you can then block app.hubspot.com
Excluding a subdomain does not exclude other subdomains on the same root domain, or the root domain itself. For example, if you choose to exclude example.thisdomain.com, you can still analyze traffic from thisdomain.com and blog.thisdomain.com.”
You might want to take a look at “Create custom analytics views”.
Also, I’d love to ask our Top Experts: Hi @TomM2, @Josh and @danmoyle do you have workarounds or other ideas to help @donrua, please?

Have a wonderful day and thanks so much for your valuable contributions!
Bérangère

@BérangèreL I’m with you on this - I think Custom Analytics Views is answer for @donrua. You can’t exclude your own specific subdomains from analytics and tracking when those subdomains are hosted in Hubspot.