AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Regex Segment that includes Pipe does not return data

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi There,

 

I'm trying to create a segment in the Audience > Technology > Network > Hostname report, to limit traffic shown to only a few specific hostnames.

 

I'm trying to use a Regex value to select the hostnames desired: exampledomainone|exampledomaintwo

 

I'm leaving out the .com's, and just using the primary words in the domain for simplicity. However no matter what I try, the above does not return any results. It returns results if I just use exampledomainone, or exampledomaintwo on their own, but as soon as I include the pipe, the results go back to zero.

 

Any ideas?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Layne H
November 2016

Regex Segment that includes Pipe does not return data

Top Contributor
# 2
Top Contributor

Hi :-)
Are you creating a segment or an in-table filter?
Did you get reported data from those particular hostnames during the date range set at the upper right for the report?

For a segment -
Conditions:
Filter > Sessions > Include
Hostname > matches regex > exampledomainone|exampledomaintwo

If an in-table filter
Include > Hostname >Matching RegExp > exampledomainone|exampledomaintwo 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Layne H
November 2016

Regex Segment that includes Pipe does not return data

Top Contributor
# 2
Top Contributor

Hi :-)
Are you creating a segment or an in-table filter?
Did you get reported data from those particular hostnames during the date range set at the upper right for the report?

For a segment -
Conditions:
Filter > Sessions > Include
Hostname > matches regex > exampledomainone|exampledomaintwo

If an in-table filter
Include > Hostname >Matching RegExp > exampledomainone|exampledomaintwo 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Regex Segment that includes Pipe does not return data

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Bronwyn,

 

Thanks for the quick response! I am creating a segment, but ultimately also want to create a filter for the view using the same rules.

 

I had my segment set to 'contains' rather than 'matches regex' and when I switched the 'matches regex' it worked correctly, so thank you for that. 

 

However when I go to create a filter for the view I've setup, I can't get it to work. I'm trying to do it as follows: 

 

Admin > Filters > Add Filter > Filter Type: Custom > Include > Hostname > Regex string

 

Am I doing that incorrectly as well? 

 

Thanks again for your help.

 

Layne

 

Regex Segment that includes Pipe does not return data

Top Contributor
# 4
Top Contributor

Hi @Layne H :-)

Filters applied to Views will not work to change/remove historical data already reported in the View


Usual best practice is to have a min of 3 views.. the default View without any filters applied.. this helps to ensure

there is always a full unedited copy of data should it be needed at any stage


You should also have one or more reporting Views.. these will have filters applied as necessary, depending on reporting needs at a minimum a "Master" reporting View will have a filter to exclude your own visits from the data, and an include hostname filter to only include hits from relevant hostnames such as the website domain, any domains being used for ecommerce tracking, or cross domain tracking or subdomains being tracked, and google user content etc.

 

and a final View for testing purposes, to which you can apply a filter.. see how it affects the data and if it works as you expect it to.. if it does.. then you can apply it to another View setup as a 'Master View" or another created View again depending on your reporting needs.

New or copied Views will not populate with past data from another View, they will only track going forward from the time they are created. Filters applied a the View level also will not affect past data already collected. They only work going forward.. but they do permanently change the data for the period of time they are applied to a View.

To create the filter.. goto Admin > View column and select the relevant View from the drop down and then click on Filters in the column further down.
+ Add Filter button
Filter Type: Custom > Include
Filter Field > Hostname
Filter Pattern > exampledomainone|exampledomaintwo
(bare in mind, filter verification is not always accurate, it is simply a guideline. Depends on how much data is in the View and also sometimes the type of filtee)

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Regex Segment that includes Pipe does not return data

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Bronwyn,

 

I've setup the three views already, so that's good. I guess the reason I'm getting the 'Filter would not have changed data' message is because it's technically not filtering the past information, it will just be filtering the future information? Therefore, it's not an issue, just the way it works?

 

Layne