Analytics
2K members online now
2K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Regular Expression filter excluding main domain not working

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi Community!

I'm having problems making work a particular Regex for excluding a particular domain. 

Maybe someone out there can help me solve this in a much easier way (or actually make this work) 

 

 

The view filter I need to create is the following: 

-Exclude my main domain: mydomain.com + www.mydomain.com + mydomain.com/anything

 -- Without excluding the following subdomains: anysubdomain.mydomain.com/anything

 

 

I've created the following Regex with the following settings but it's not working: 

Filter type: Custom

Filter Field: Hostname

Filter Pattern: (\w*|www\.)qwilr\.com(\/\w*)?

 

Can anyone tell me what's wrong with that regex or if there is something else I can do? 

Regular Expression filter excluding main domain not working

[ Edited ]
Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Santi,

 

This regex should work properly: ^(www\.)?qwilr\.com$

 

You can test it out with this tool: http://www.analyticsmarket.com/freetools/regex-tester

 

Let me know if it helps @Santi C.

Taavi