# Exclude subdomain from analytics

**URL:** <https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202>\
**Category:** Reporting & Analytics\
**Created:** [January 4, 2023, 3:27pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202 "2023-01-04T15:27:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CStenger](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@CStenger](https://community.hubspot.com/u/CStenger)\
**Post date:** [January 4, 2023, 3:27pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/1 "2023-01-04T15:27:43Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![daithi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/daithi/32/197328_2.png) [@daithi](https://community.hubspot.com/u/daithi)\
**Post date:** [January 4, 2023, 7:28pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/2 "2023-01-04T19:28:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CStenger](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@CStenger](https://community.hubspot.com/u/CStenger)\
**Post date:** [January 6, 2023, 7:14pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/3 "2023-01-06T19:14:48Z")

</div>

![Screenshot 2023-01-06 at 2.11.45 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/6/769a37a18d98616f416611255f5574f822bdb320.png)  
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!

---

<div class="post-metadata">

**Author:** ![Sasha-A8](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sasha-a8/32/5385_2.png) [@Sasha-A8](https://community.hubspot.com/u/Sasha-A8)\
**Post date:** [August 20, 2024, 3:07pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/4 "2024-08-20T15:07:23Z")

</div>

This sounds like it was written by ChatGPT.

---

<div class="post-metadata">

**Author:** ![CStenger](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@CStenger](https://community.hubspot.com/u/CStenger)\
**Post date:** [January 13, 2023, 4:32pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/5 "2023-01-13T16:32:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![donrua](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/donrua/32/65886_2.png) [@donrua](https://community.hubspot.com/u/donrua)\
**Post date:** [September 15, 2025, 7:52am UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/6 "2025-09-15T07:52:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [September 15, 2025, 12:13pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/7 "2025-09-15T12:13:15Z")

</div>

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](https://knowledge.hubspot.com/reports/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](http://hubspot.com) is included as a site domain, then, [app.hubspot.com](http://app.hubspot.com) cannot be excluded. If the site domain were a subdomain such as [www.hubspot.com](http://www.hubspot.com) instead of the root domain, you can then block [app.hubspot.com](http://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](http://example.thisdomain.com), you can still analyze traffic from [thisdomain.com](http://thisdomain.com) and [blog.thisdomain.com](http://blog.thisdomain.com).”  
You might want to take a look at “[Create custom analytics views](https://knowledge.hubspot.com/reports/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

---

<div class="post-metadata">

**Author:** ![danmoyle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danmoyle/32/91166_2.png) [@danmoyle](https://community.hubspot.com/u/danmoyle)\
**Post date:** [September 15, 2025, 1:56pm UTC](https://community.hubspot.com/t/exclude-subdomain-from-analytics/72202/8 "2025-09-15T13:56:06Z")

</div>

[@BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185) 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.
