Set up a hostname filter in Google Analytics that will add your page’s subdomain information to your reports to easily and accurately analyze your traffic and distinguish different subdomains
You should be able to easily and accurately analyze your traffic reports and immediately distinguish the traffic among your subdomains
Why it matters
If your website has multiple subdomains, Google Analytics will aggregate data that has the same page path. Understanding which sessions belong to which subdomains will require you to go through a few extra steps every time you’re analyzing results. This filter adds the subdomain information straight to your reports
Before you start
You need to have Google Analytics running on your website and all your subdomains, if you haven’t added it yet you can do so by following SOP 009 (web version). The specific steps on this SOP apply only in Google Analytics 4 (newest update). Starting on July 1, 2023, standard Universal Analytics properties stopped processing new data, and all customers will lose access to the Universal Analytics interface and API
Key steps
22 steps
What is inside
24 headings
1Adding a Hostname Filter17
Go to your Google Analytics Admin panel by clicking here .
If you have multiple Google Analytics accounts make sure you have selected the correct account, property, and view:
Go to "Admin" by clicking on the gear icon on your bottom left
Click on "Admin" and navigate to "Data collection and modification" then select "Data filters"
Next, click "Create filter"
Then, select "Internal traffic"
Next, key in the data filter name
and then select "testing" to test the filter state
To check if the data filter testing is working, go to "Data collection and modification" > "Data streams" and select the data account. It may take some time for the account to receive traffic, especially if you are new to creating a data stream.
Next, we recommend to configure your traffic behavior. Scroll down and click "Configure tag settings" under "Google tag"
Click "Show more", scroll down and select "Define internal traffic"
You will then want to create new internal traffic rules
Here, please input a rule name (No.1) and your IP address (No.2 and No.3) before clicking the "Create" button (No.4)
[Recommended] Next, go to "Reports" on the navigation menu > "Examine user behaviour" > "Events" and click on the + button to filter your data
Condition your filter to only receive data including your hostname. By doing this, the data retrieved would be relevant and more accurate that matches exactly to your hostname only.
Additionally, ensure that your customized data report includes your hostname only. Click on the pencil icon on your top right and then click "Add filter". Follow the same step as the above.
Lastly, click "Save" to save the customized and filtered data report. That's it!
2Checking If your filter is working as intended5
Open your website homepage using Chrome.
Click on the Tag Assistant Companion Chrome Extension.
Click on “Enable”
Refresh the page and click on the Google Tag Assistant Chrome Extension again.
You should see a green tag for Google Tag Manager, indicating that the installation was successful.