Filter out web hostname traffic in Google Analytics

Important: Traffic filters only apply to new data and won’t change previously collected data in your reports. Learn more about applying filters to detail reports .

Improve your Google Analytics reporting accuracy by filtering out web hostname traffic. This helps you focus on real user behavior and make better business decisions.

Before you begin

Before you can filter web hostname traffic, ensure that you know the specific domains or patterns of the unwanted hostnames you want to filter out.


Step 1 of 3: Create a data filter

You can use the settings to create a data filter and exclude web hostname traffic. To do this:

  1. In Admin , under “Data collection and modification”, select Data filters .
    Note: The previous link opens to the last Analytics property you accessed. You must be signed in to a Google Account to open the property. You can change the property using the property selector. You must be an Editor or above at the property level to create a data filter.
  2. Select Create filterand select the template for web hostname filtering. For example, Web hostname traffic filter.
  3. Enter a name for the data filter. The name must:
    • be unique among data filters in the same property
    • begin with a letter or character from any language (full unicode support)
    • contain only unicode letters and numbers, underscores, and spaces
    • contain up to 40 characters
  4. Choose Includeor Excludeand ensure that the hostname meets the requirements for length limits.
  5. Choose from the following match types:
    • Exactly matches: The parameter value must be completely identical to the string you enter, with no extra characters before or after.
    • Contains: The parameter value must include the string you enter anywhere within it.
  6. Choose from the following filter states:
    • Testing: Analytics identifies matching data with the "Test data filter name" dimension. You can use this to validate your data filters before you activate them.
    • Active: Analytics applies the data filter to incoming data and makes permanent changes.
    • Inactive: Analytics isn't evaluating the filter.
  7. Click Create.

Step 2 of 3: Validate your traffic filter

It’s advisable to test your data filter before setting it to active to confirm that it works as expected. If you set the data filter to Testing, wait for 24-36 hours before you validate.

Build a validation exploration

  1. In Explore , under “Start a new exploration”, select the Free formtemplate.
  2. In the “Dimensions” panel, add Test data filter nameand Event name.
  3. In the “Metrics” panel, add Event count.
  4. Drag Test data filter nameand Event nameinto the “Rows” panel.
  5. Drag Event countinto the “Values” panel.
  6. In the “Filters” panel, add Test data filter name.
  7. Set the match type to “contains” and enter the exact name of your data filter.
  8. Click Apply.

Verify the result

If the filter works, the table should show “Event counts” next to your data filter’s name, grouped by hostname. This confirms that traffic matching your criteria is flagged for exclusion. Review the hostnames in the results to verify that only unwanted hostnames are being caught. If you see legitimate hostnames, adjust your matching conditions in Step 1 before activating.

Note: You can return to this free form exploration at any time to re-validate your hostname filter.

Step 3 of 3: Activate your traffic filter

After validating your data filter, you can now activate it to permanently filter out the web hostname traffic from your data. To do this:

  1. In Admin , under “Data collection and modification”, select Data filters .
  2. Click the data filter you validated.
  3. Under “Filter state”, select Active.
  4. Click Save.
Note: After you set a filter to Active, it will begin to filter data within 24-36 hours.

Related links

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
17494009771289002024
true
Search Help Center
false
true
true
true
true
true
69256
true
false
false
false
Design a Mobile Site
View Site in Mobile | Classic
Share by: