Search code examples
google-analyticssubdomain

google event tracking - how to exclude subdomains


I am new to google analytics and did not really found anything what appears to be what I want.

I have a site: https://www.example.com

domain would be example.com

I also have a subsite for testing which I do not want to track at all:

https://www.test.example.com

How would I exclude those events? Setting up my tracker like this... :

  ga('create', 'UA-xxxxxxx-x', 'auto', 'myTracker');

will result in getting events for all subsites of mysite.com.

Update: Actually the domain I want to track is like:

https://www.prod.example.com

So tried filtering, excluding other subdomain test.example.com :

enter image description here

..without success. Moreover I would not know how to exclude multiple subdomains.

Sorry for the german interace. Filter is : Exclude->Pattern->Applyto->All


Solution

  • You can create include and exclude filters to track or block hits from subdomains. In your case, for example, you could create a filter that excludes all hits (like your event) from www.test.example.com. You can't direct where hits go in the hit itself, but you can filter them out in your views.

    Edit: to exclude data from a specific subdomain, you would need to use a Hostname filter. It looks like you are filtering by Request URI (Anforderungs-URI) which would not work as that refers to the page path and not the hostname.