4.2K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
Guide Me

Exclude spam by extension?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have been using GA for six days. So far, my domains have gotten 20 - 30 ghost visits a day from


I see a pattern here, but the filter didn't like "*.xyz"; when I verified it, it allowed visits from How do I tell the filter to exclude anything from an "xyz" domain?


1 Expert replyverified_user

Re: Exclude spam by extension?

[ Edited ]
Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭


Did you make your filter settings so?

Filter Type: Predefined
Exclude - traffic from the ISP Domain - that end with
ISP Domain: xyz

I guess this filter will exclude all traffic from hostname who that end with "xyz"
And also you can find below regular expressions types.

Mini advice, for using filters, may you should create a test view first. If is it working as you want then you can configure your filter setting on your master view. And sure make one of your views in your property whitout any filters. For your raw data.

Marked as Best Answer.
Accepted by topic author Ted P
January 2016

Re: Exclude spam by extension?

Rising Star
# 3
Rising Star
Hi Ted,

Scheref, a hostname is the place where the visit arrives that would be mainly your own domain. So what you need to exclude referrals is:

Filter type: Custom > Exclude
Filter field: Campaign Source
Filter Pattern: .xyz$

The dollar sign ($) means ending. That filter will catch and exclude all referrals ending in .xyz

However, that could be risky because there might be valid referrals using that TLD. If you check the hostname of these sources you will see that they are fake or (not set)

So a better solution is to create a filter that will only allow traffic that has a real hostname. That way you will stop most of the spam, and you won't have to keep creating/updating filters as new ones show up. You can find more information and a detailed guide for this solution in this post:

Hope it helps,
Google Analytics Rising Star | Was my response helpful? If yes, please mark it as the 'Best Answer.' Learn how here!
Analytics Consultant at - Find me on Twitter | Email me

Re: Exclude spam by extension?

[ Edited ]
Follower ✭ ✭ ✭
# 4
Follower ✭ ✭ ✭

Yes you right not hostname, ISP Domain. (Traffic from the ISP Domain)  

Sorry again.