Welcome to WebmasterWorld Guest from 54.198.52.8

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

What is the OR Operator in GA Segments

     
6:13 pm on Jan 28, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:June 16, 2010
posts: 3823
votes: 29


Google is killing me lately...

What is the OR operator when using multiple values in the sources in advanced segments.

I am trying to exclude both spamsite1 and spamsite2 from sources

So I tried:

does not contain: spamsite1|spamsite2

and it doesn't seem to work, even though I think it is the right operator for filters.

so I am guessing that | is not the "or" operator

Also tried || and just the word "or" with no quotes.

So if there are multiple spam sites sending me traffic, how do I get rid of them in segments?

Thanks in advance.
7:39 pm on Jan 28, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 20, 2006
posts:1949
votes: 30


The OR operator is a regex Operator, not an Analytics operator.
Instead of contain, use regex, then the pipe's magic works.
7:56 pm on Jan 28, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:June 16, 2010
posts: 3823
votes: 29


A RhinoFish:

Thanks for the note.

I am trying to EXCLUDE two referring sites, so you are saying it should read:

does not match regex: spammysite1|spammysite2

Is that correct?

Thanks in advance.
12:14 am on Jan 29, 2016 (gmt 0)

New User

joined:May 13, 2014
posts:6
votes: 2


Yep that's right.
12:50 am on Jan 29, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:June 16, 2010
posts: 3823
votes: 29


Thanks for the help.

While I have been able to get MOST of the spam sites excluded from the segment, i am having problems getting one of the spam referral sites excluded, and am not sure why.

The site is a subdomain format, to examplfy it:

noun12345.somedomainname.tld

I tried adding

|somedomainname

To that regex expression (which already has a few other domain names in it) and it doesn't work. The traffic is still show even when the segment is applied.

So I tried adding the subdomain by using:

|noun12345

I have also tried:

|noun12345.somedomainname

and

noun12345.somedomainname.tld

And that didn't work either.

Don't know what to do here...
9:19 pm on Jan 29, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 20, 2006
posts:1949
votes: 30


The period is a Regex operator, you want to convert the period character from a period Regex operator to a period literal character.
A backslash escapes special characters, turning them into literal characters.

So instead of: noun12345.somedomainname.tld
Try: noun12345\.somedomainname\.tld

Be careful, use backslash (\) not slash (/).

See special characters here:
[regular-expressions.info...]
10:08 pm on Jan 29, 2016 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14036
votes: 522


In this situation, though, failing to escape a . period would be a non-lethal error. That is, all you're doing is creating a rule that would inadvertently also match
noun12345xsomedomainname
noun12345:somedomainname
noun123456somedomainname
et cetera and, although that wasn't your intention, it's not likely to do any harm.
5:39 pm on Jan 30, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:June 16, 2010
posts: 3823
votes: 29


@ Lucy24
@ RhinFish

Thanks for the help.

It looks like in my big string of domains, I did have an unescaped . and it seems like it was messing up everything else that was following it.

I think that took care of it. but will let you all know.

Thanks again!
7:47 pm on Jan 30, 2016 (gmt 0)

New User

joined:May 13, 2014
posts:6
votes: 2


Apologies Planet13, I should have followed this closer and apologies if i misled you. I should have mentioned escaping the period, but I assumed that filtering spammy sites would include all mentions but lucy's right and we all know what assumed did.

I do have a question though @Lucy24 and @RhinoFish
Planet 13 wrote
"The site is a subdomain format, to examplfy it:
noun12345.somedomainname.tld
I tried adding
|somedomainname
To that regex expression (which already has a few other domain names in it) and it doesn't work. The traffic is still show even when the segment is applied. "

I'm not sure why this wouldn't work? When I'm using segmentation in GA, and have www.mysite.com and exclude "mysite", it filters it out.

If the list was, say, toomuch.spammysite.com|morespammysites.net|somedomainname

I can't see how a referral with somedomainname in it would still be included. I feel like I'm being really stupid here...
10:41 pm on Jan 30, 2016 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14036
votes: 522


Is it possible GA handles subdomains differently, so when you say "somedomainname" it interprets it as
EITHER /somedomainname OR /www.somedomainname
BUT NOT any kind of
/blahblah.somedomainname
? (That's my best guess. I don't know how GA works on this level.) Is there a wild-card option, like *.somedomainname ?
10:44 pm on Jan 30, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 20, 2006
posts:1949
votes: 30


You're not stupid, it's just that the Analytics folks have to make a LOT of decisions on how to record and present data, and they aren't always obvious. :-)

First, you're filtering on Source, not Referring Domain (that's what you said anyhow).
Look through your Source data that is there.
You'll see things like "facebook.com".
But when you visit Facebook, you're on www.facebook.com.
For the sake of reporting simplicity, Source groups www and (non-www) as the same thing.
If however, it's traffic from a subdomain, like m.facebook.com, it reports that as a separate Source.

Go to Acquisition, All Traffic, Referrals... you'll see a list of traffic there, by Source...
Type facebook into the filter box -- see the lack of www?
Now erase the filter box, then type www into the filter box -- get it?

Also, for matching things, it can be "do these two things exactly match" or "can i exactly find the needle string within / inside the haystack string" or "can i exactly find needle in haystack when I start comparing character1 in needle to character1 in haystack"..
string == string
string == jjjjstringjjjj
string == stringjjjj (when you don't specify starting position... ahh, you'll get what I'm saying. mysite will filter mysite.com, but not hello.mysite.com)

Have fun!
10:15 pm on Feb 16, 2016 (gmt 0)

New User

joined:May 13, 2014
posts:6
votes: 2


(Lateness apologies) But thanks very much @RhinoFish @lucy24!