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
-
Paid traffic or "Paid Search" is not showing in my Google Analytics
Hi, I have two campaigns running in Google Adwords or Google Ads now and I saw in Google Ads account that I had 5 clicks today (09/18/2018) but when I try to search for this clicks in my Google Analytics in ACQUISITION > All Traffic > Channels I don't find nothing about "Paid Search" or something like that. Bellow is a picture of my Google Analytics account to prove it. The accounts are linked and I can find the 2 campaigns in the Analytics. How can I interpret this picture? Where the paid traffic is showing? or not showing there? Thanks Leandro uvAtrsg
Reporting & Analytics | | lmoraes0 -
Organic search traffic down 60% since 8/1/18\. What now?
I have a small health & fitness blog, and my Google search traffic suddenly dropped 60% around August 1 (I've attempted to link an image). My rank has dropped for 86 keywords. I have no manual penalty, so I'm guessing I was affected by the algorithm change. My technical skills are VERY limited. I've tried to find answers on my own, but every time I try to "fix" something, I only seem to make it worse. I do seem to have some structural/performance issues with my site (e.g., lots of 404 errors from uninstalled plugins and unwanted permalinks). I asked my server for assistance (I used managed Wordpress hosting), and they said they couldn't help. As you can imagine, this is quite devastating, and I have no clue where to go from here. I don't know if I'm allowed to link to my site here, but it's mommyrunsit dot com. Any assistance is greatly appreciated. Thanks. Sharon 0lPu4wY
Reporting & Analytics | | RoniFaida1 -
Internal Referral Traffic Issue due to https/http?
Hi Mozzers, we´re running a secured https account section on our website including a messaging center where lots of non secured own URLs are being shared among the users. Is there a possibility that a user clicking on one of the shared URLs within the https section triggering another session thats been counted as direct traffic? Thanks for your help! Greets
Reporting & Analytics | | LocalIM
Manson0 -
Huge Traffic Drop after 301, Keyword and Schema.org Fixes
Hello there, I'm first gonna explain what I did to my website: I was using a 302 redirect to send from http to https, fixed it to a 301. My url has a keyword and I was using many pages with keywords as well. ex) www.keywordhaha.com/keyword-the-best , www.keywordhaha.com/keyword-easiest-on-keyword-market Changed it to : www.keywordhaha.com/app , www.keywordhaha.com/games, etc... I was not using any crawler tools, so I added Schema.org, Json-LD and rdfa-node, which are all working properly. Synced my page with our Google+ page, which was recognised by Google Added a proper logo and fb:admins, and was recognised by facebook. After I did all this optimisations, I experienced an immediate traffic drop (10%) and my impressions/clicks according to the webmaster tools dropped 75%, in a 2 day period. Any ideas where there could have been a mistake? mPdhFdG.png
Reporting & Analytics | | jancpc0 -
Bing Webmaster Tools data discrepency on traffic
Hi, For a given time period in Bing Webmaster Tools it says that combined clicks from Bing and Yahoo organic search are about 4,700 total, for the same time period in Google Analytics, combining sessions for Bing and Yahoo Organic comes out to about 8,900 total. Has anyone else experienced this discrepancy? Is this common? How can I get 8900 visits from 4700 clicks?
Reporting & Analytics | | IrvCo_Interactive0 -
Loss of Google referral traffic after server move / CMS move
I have a client that changed from MoveableType to Wordpress. He also changed from a dedicated server to WP Engine. He may have blocked search engines for a week or two, so his organic traffic is down but only by 25%. He's 301 redirecting all of the old pages. The mystery is that his referral traffic from Google is down 90%. It's a popular blog, so that's thousands. It's been going on a month now. Anyone seen this before?
Reporting & Analytics | | Hyper-Dog0 -
Why is my direct traffic down DRASTICALLY?
I have been seeing a trend for a while that is intesifying. My direct traffic numbers are down A LOT. We are not down 50% to LY (in actual number not just percentage of traffic) I am trying to understand what could be the causes of this issue. I was considering simply bigger meaner competition, but I actually perform decently on my returning customers. Also my performance on my brand keyword is more inline with my current trend so I would except these KW to do equally as bad if the actual brand/store was the issue. The more surprising even, is the fact that I can trace back the start of the trend exactly to the day. Overnight on Sept 22 LY direct traffic went down 30% (to LY) when it was trending UP 20-25%(to LY) before. Now, we did do a redesign of the website on May 2011 (4 months before the drop), and did change host Oct 2011 (a couple weeks after the start of the trend). Do you have any clue as to why this could be happening? Did GA start tracking direct traffic differently?
Reporting & Analytics | | CassisGroup
Any thoughts?0 -
Has Google changed its algorithm? My traffic has almost doubled and I don't know why.
My traffic has nearly doubled over the past few days, and my conversion rate has doubled as well. It looks like our rankings haven't changed... We haven't done anything to the site recently, although we did submit a couple of press releases through the wire not too long ago (within the last few weeks). I do not think that this is a cyclical/seasonal jump in traffic because last year this did not occur. Any ideas?
Reporting & Analytics | | deuce1s0