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.
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
-
GA4 account & property not showing in traffic property setup list.
Hi there, I've connected multiple client accounts to GA4 already, but three of our accounts that we have administrator rights to in GA4 are not showing up in our selectable accounts/properties list when logged in via Moz to add to the traffic settings area. Anyone else have this issue and find a fix?
Reporting & Analytics | | luminusagency0 -
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 -
Goals tracking across subdomains
Hi all, I'm having some trouble with regards to setting up goals tracking in Analytics across subdomains and was hoping that someone could help me out. Okay I work for an insurance company and we use a Quote & Buy portal for our insurance policies. Our website - www.example.com sends the traffic to quotes.example.com. Both of these sites have the same Google Analytics tracking ID. The quotes.example.com has no duplicate URLs which appear one our website, therefore I only set up the account to only include the hostname for each. Does this sound correct? The goals issue is if I now set up a goal in the quotes.example.com account, someone comes to www.example.com via Google and then clicks through to our journey and completes, will this count as a referral from www.example.com or as a goal from Organic? I'm totally stuck so any help would be appreciated. Thanks Ben
Reporting & Analytics | | Markerstudy0 -
Tracking Goals on a Subdomain?
What needs to be done to Analytics to track goal completions on a subdomain? The main Analytics profile is set up for example.com, but landing pages for paid campaigns are set up at sub.example.com. Thank-you page is sub.example.com/thank-you.php What needs to be modified in Analytics (or to the Analytics code) or how do the goals need to be set up to track these subdomain conversions all within the same Analytics profile? They're not tracking currently. Thanks.
Reporting & Analytics | | elcrazyhorse0 -
Our Firefox organic traffic seems to have been re-allocated to direct - anyone know why?!
In Google Analytic, the majority of organic traffic via Firefox browsers to one of our websites suddenly dropped off, and an immediate lift in direct traffic via Firefox browsers appeared. This trend has continued ever since. I've searched to find Firefox releases that might have affected it (eg. security/cookie settings), but haven't been able to find anything, or talk of this happening to other people, and the anomaly doesn't appear in our other website analytics either...anyone have any ideas?! The attached GA graphs show Firefox browser versions 21.0 and 22.0, but it's the same story across all versions. (You can also see that I'd also filtered out traffic via IOS 6 and Android 4 operating systems to remove any effect from these known issues). Thanks for any help that you can offer! kPRnrcd.png dy0Bjg7.png
Reporting & Analytics | | HubMDP1 -
Using the SEOmoz API with SEOTools for Excel
Hi there, I'm trying to use the SEOmoz API in Excel, to get the Domain Authority and MozRank for a bunch of URLs. I've tried multiple techniques, but I can't get it to work. The code I currently got is from SEOGadgets post, and I'm using the SEOTools for Excel plugin. Here is what I got: =JsonPathOnUrl("http://lsapi.seomoz.com/linkscape/url-metrics/"&A3&"?Cols=68719476736";"$..pda";"<httpdownloader cache="false" pause="1" authenticateuser="REDACTED" authenticatepassword="REDACTED" requestmethod="GET"></httpdownloader>") The problem is, it always returns 1 for every URL. Can anyone explain what I'm doing wrong? Or show me an easier way to do this? I have double checked the API keys and tested on multiple URLs.
Reporting & Analytics | | Qon1 -
A lot of traffic to one page from Google referral
We recently received a lot of traffic to one page from
Reporting & Analytics | | underthesun808
google.com referral. When I look in analytics it reports that the traffic is
coming from /url that’s not real helpful. Is there a way to get more specific
information as to what the referring url was?0 -
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