How to filter out traffic from subdomain using regex?
-
Hi There,
We have a test server that lives on a subdomain which we'd like to filter out in Google Analytics.
We're using the hostname filter but are having trouble understanding the regex needed, we're using this as the filter pattern:
Will that work? The profile is new so we can't test the pattern. Any pointers in the right direction would be much appreciated.
Cheers
Ben
-
Actually, I this we just put the hostname in there right?
A previous consultant had put a regular expression in there (the one from the question) but I suspect we just add the hostname.
-
Or do we just put this into the field?
domain
Will simply find 'domain' anywhere?
Cheers
Ben
-
Thanks Martijn, much appreciated.
It now looks like we're escaping the . (dot) - is that right? We're actually trying to match anything before and after 'domain' - to match any site on our test server.
Do we need something like this instead?
^domain.
Sorry I'm not understanding how this works - have read so many tutorials but can't figure out what the 'anything' character is?
Cheers
Ben
-
Hi Ben,
This won't completely work as the . (dot) also has a function in Regular Expression which means it can be any single character. So what you need to do is escape that one. Then it will eventually become something like:
.*domain.com.
Martijn.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Referral Traffic from Google
Hello, I have a question about my company's new website. I've worked in SEO and studied Google Analytics results for a few years now but have never really come across something like this. I started in this position in January of this year and when I started breaking down the traffic sources in Google Analytics, I noticed most of the traffic was coming from Google.com as a referral source. I had never seen Google.com as a referral source before so I looked into options for what it could be. It was not a paid ad and our organic traffic was coming through in Analytics, Before I could get any further, our new website was launched (we switched CRM's to WordPress) and the referral traffic from google went from 2,966 in January of 2015 to 22 in February 2015. for more comparison, in February of 2014, the referral traffic from Google was 2,496. I expected a drop when we switched CRM's but we correctly re-directed all pages and created a new sitemap and our organic traffic is up since the switch (not enough to cover drop in referral). I thought at first this had to do with our Google sellers account being de-activated when we made the switch, but I quickly fixed this over a month ago and no change. I'm wondering if anyone has ever seen Google.com come through as a referral source in Google Analytics and if they we're able to figure out what it actually was. This would be a great help! Thank you, Alex
Reporting & Analytics | | RASEO1 -
Track subdomain in analytics
Hi, Our jobs section has recently been moved on to a subdomain https://jobs.ourwebsite.co.uk/home.html which is handled by a third party. Our analytics for the jobs section was lost as no code was added to the pages. Previously it was part of the main site. How do I track it as a subdomain so that it appears to be part of our main site? We have the old GA and universal GA code on the site Thanks
Reporting & Analytics | | Houses0 -
Drop in direct traffic
Hi, I help look after two websites and have been tracking traffic sources for a couple of years. I have noticed that both sites have seen a drop in direct traffic over 2 years. Has anyone else noticed this and do you have a hypothesis as to the reason? Overall, on both sites traffic has increased. Thanks, Amelia
Reporting & Analytics | | CommT0 -
Referral Traffic Issue
I'm working on a site that has low traffic volumes due to its niche. That's fine but we are daily getting referral traffic from unrelated domains without a link. These visits are always 100% bounce which is impacting the overall click.through rate. The domains are not the same and different ones come through all the time, so it is difficult to keep on top of. Any ideas what could be going on here and an effective way of dealing with this?
Reporting & Analytics | | MickEdwards0 -
Can anyone diagnose drop in organic traffic? (Screenshot attached)
I have an unexplained drop in google traffic on the 9th July. There are no messages in webmaster tools and no onsite or link building had taken place. In fact there were no changes at all. The only possible thing I can think of is that for some time I have had a problem where the bounce rate for my site was 95% plus in analytics. That data is wrong as the website is converting 1in 10 visitors and for them to convert the bounce rate would 90% (If EVERY other visitor bounced) as they have to visit several pages to do so. Any help appreciated! b457MPe.png
Reporting & Analytics | | SamCUK0 -
My website traffic drop two times
Hi all, on our website www.watchalyzer.com I have unique content that we are writing especially for this online magazine. In last two months our traffic dropped two times. First time on October 20th and after 20 days traffic got back on November 10th. Second time traffic dropped on November 15th and it is still down Does somebody have idea what could be reason for this and how it can be fixed? thanks, Nikola
Reporting & Analytics | | GearyLSF0 -
Use SEOmoz API in Google Docs Spreadsheet
Hi, Has anyone made functions to get link metrics from SEOmoz API in Google docs spreadsheet? Page Authority Domain Authority Linking Root Domains Total Links _Thanks to Tom Critchlow I got the social metrics, now I just need the ones from SEOmoz api. _ Any help would be sweet.
Reporting & Analytics | | EdgySEO0 -
Why do I get lots of traffic from a bizarre keyword?
Bit of an odd one but I've been getting a large and steady stream of traffic over the last few months from a very random keyword that according to addwords figures shows "on data". Its our second biggest referring term only beaten by our brand name. We get more traffic from this term than keywords we have invested a lot of time in that show thousands of traffic volume in addwords. When looking at behavioral data its gets odder, a bounce rate of 98.11% time on site 2 seconds and page visits 1.02. So this traffic isn't real traffic and it's not real people. So my questions are, what is it? why do we get this random traffic, has anyone els noticed things like this and is it a problem? I presume it must be something to do with some sort of spam but apart from that i'm stumped. It's just one of those things that has been bugging me so I would appreciate any help. Kind Regards Paul
Reporting & Analytics | | pauldoffman0