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
-
Linked my adwords account to GA and vice versa and still paid search is getting recorded into organic traffic??
Hi Mozzers, I have linked properly my adwords account to GA and vice versa and somehow I can see 3/4 of this paid traffic recorded to organic search. The most confusing part is that I can see 1/4 of the paid traffic under the "paid" metric. At this point I don't know really what should I do? Thank you guys in advance!
Reporting & Analytics | | Ideas-Money-Art0 -
Enable Demographics and Interests reports using analytics.js
Hi, I may be going mad, but i can't find the code to activate demographics and interest reports if you are using the new analytics code. I can only find the code adjust for the old code. Any one know where to find this? Thanks Paul
Reporting & Analytics | | eminent0 -
Direct Traffic Spike
In February, I transferred an HTML site to a WordPress Platform. Since then, Direct traffic has spiked to nearly 400% since the WordPress transition. The Direct traffic spike took roughly 2 months before it started to kick in. Does anyone know what this could be attributed to?
Reporting & Analytics | | SteveZero120 -
Why do I have a lot of direct traffic from MSN and Yahoo with 100% bounce rate?
For MSN I have about 8000 hits of one page and a 100% bounce rate. In the last month I have about 400 hits from Yahoo with a 100% bounce rate. Msn is all different pages, while Yahoo is all the home page. What would cause this?
Reporting & Analytics | | EcommerceSite0 -
When will traffic data be working ? also whats with the spike in duplicate listing issues with everyone.
Hi There, We have no traffic data, is this something we are doing wrong or is this an issue with SEOMOZ ? Also duplicate listings have gone sky high, check goggle analytics's and all ok ? Any answers ? Thanks Charlie
Reporting & Analytics | | pro580 -
Google Analytics traffic hijacking?
Ran into something interesting a week ago - the same Google Analytics code was installed on two different sites by accident. The account was reporting traffic from both domains. Haven't found a definitive answer on how to stop this yet if it were to be used maliciously?
Reporting & Analytics | | khemistry0 -
Amazon.com inc.increase in direct traffic
Hi All, I have seen a increase of direct traffic from hostname amazon.com inc. This only happened on one day. Any ideas what/why it is? Thanks
Reporting & Analytics | | Sayers0 -
Search Traffic Drops Before It Improves?
I'm working on a site with tons of great, useful content....the owners of the site implemented a new site layout and design (complete overhaul) and they were lacking basics such as meta descriptions, 301 redirects, and, shockingly, they had the same Title tag for every single page on a site with thousands of unique how-to articles. Unsurprisingly their traffic dropped by about 300%. They generate most of their traffic from people learning how to build stairs, how to install crown molding, and other related matters. Beginning last Thursday I've been performing basic on-site SEO, things like having unique titles for each page and similar tasks. The week from Thursday when I began until yesterday (Wednesday), Google traffic dropped -29.73% - 17,715 vs 25,210 I believe this is a normal part of the "Google Shuffle" -- does anyone have a Matt Cutts link or similar proof that this is a normal part of the process?
Reporting & Analytics | | wattssw0