Google Analytics subdomain filter

It is possible in Google Analytics to show or hide domains and subdomains by using filters for a specific view, in Admin > View > Filters > Add filter.


How to fix redundant hostnames in Google Analytics

It is possible in Google Analytics to show or hide domains and subdomains by using filters for a specific view, in Admin > View > Filters > Add filter.

Adding or removing a filter will however not change existing data, but will be applied on the future visits that will happen on the site.

Google Analytics tutorial filters

On the page view report, in below example, the subdomains and domain are not shown. But the traffic is coming from several domains : https://www.wcifly.com, https://wcifly.com, and https://travel.wcifly.com.

This distinction is actually not visible on the page view report, and a filter must be added.

Google Analytics filters

First of all, it is necessary to find the view on which the filter will be applied and the subdomain will be added or removed.

Go to the admin panel, accessible in the bottom left of the sign, the gear icon Admin, and navigate to the view corresponding to the Analytics account and property to update. There, select the filters option.

Once in the filters menu, the different filters, if any, will be displayed in a table.

It is possible to add new filters in order to display or manage the subdomains, and append or prepend them to the Analytics results, and to delete the filters to hide the subdomains.

Google Analytics hostname append

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

In the new filter form, there are plenty of options, which can be useful for big websites, or when managing several domain names, subdomains, and websites on the exact same view.

For example, to prepend hostname, select an advanced filter, and put the wildcards (.*) to both field A and field B, meaning to both the domain and the page.

Show full URL Google Analytics

Then, put both field A and field B as output, which will that way show a full URL, and not mix pages which have the same path on different subdomains together.

Do not forget to check that the field A is setup as required, and to override the output field.

Redundant hostnames Google Analytics

After a while, the hostnames should be visible on the Google Analytics pages report.

The URL will be shown in full, and two pages with similar name but on different subdomains will not be mixed together anymore.

How to Quickly (and Correctly) Track Google Analytics Across Multiple Domains

Frequently Asked Questions

How can webmasters set up filters in Google Analytics to track traffic separately for subdomains, ensuring accurate data analysis?
In Google Analytics, create a new view for your property, then go to Admin > Filters and add a new filter. Choose Custom for Filter Type, select Include, and specify the hostname of the subdomain. This allows for the separate analysis of traffic to different subdomains.

Yoann Bierling
About the author - Yoann Bierling
Yoann Bierling is a Web Publishing & Digital Consulting professional, making a global impact through expertise and innovation in technologies. Passionate about empowering individuals and organizations to thrive in the digital age, he is driven to deliver exceptional results and drive growth through educational content creation.

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!



Comments (0)

Leave a comment