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
-
Measure traffic from serp feature
Hey 🙂 Does anyone know if there's a way of measuring traffic coming through serp features? I know that you can get some info on SEMrush but not traffic coming from those specific results like stories and instant answers. Thanks!
Reporting & Analytics | | Anna_90 -
.com site referral traffic to ccTLDs
We have 7 international domains set up along with our main .com site. All of the ccTLds are showing their main referral traffic as coming from the .com site in GA, and most of those being from mobile. Each site is set up correctly with geo-targeting and hreflang tags. Has anyone experienced this before?
Reporting & Analytics | | ggpaul5620 -
Bot Traffic Higher Than Unfiltered?
We filtered bot traffic from one of our Google Analytics accounts and traffic is higher than with the unfiltered view. Does anyone have an idea what might be causing this?
Reporting & Analytics | | Leithmarketing0 -
Google Analytics - Organic Search Traffic & Queries -What caused the huge difference?
Our website traffic dropped a little bit during the last month, but it's getting better now, almost the same with previous period. But our conversion rate dropped by 50% for the last three weeks. What could cause this huge drop in conversion rate? In Google Analytics, I compared the Organic Search Traffic with previous period, the result is similar. But the Search Engine Optimization ->Queries shows that the clicks for last month is almost zero. What could be the cause of this huge differnce? e9sJNwD.png k4M8Fa5.png
Reporting & Analytics | | joony0 -
How to Track Button Clicks as Events in Universal Analytic using New Interface of GTM?
Hello Experts, How to Track Button Clicks as Events in Universal Analytic using New Interface of GTM? Also is there anything code we have to do on website also to track buttons? Sorry to say request please don't just share any post, please give specific answer or share very relevant post. Your input is really very valuable to me. Regards, Mitesh
Reporting & Analytics | | bkmitesh0 -
New e-commerce launched, drop in traffic
One of our clients launched a new e-commerce site and there was a significant (60%) drop in traffic in Google Analytics following the launch. We are about 10 days into the new site, and our suspicion is that the move has caused a decrease in their site authority which has lowered their search position. The old site had the store at sitename.com/store. The new site has a Shopify store at shop.sitename.com. There were very few external followed links to the store pages, so we thought that there would be little effect for overall site traffic by moving the store to a subdomain. Any recommendations for next steps on diagnosing the problem and working towards a solution?
Reporting & Analytics | | DesignHammer0 -
Google Webmaster Dropped Traffic
Hi Guys, I've recently implemented a new site design with a new url architecture etc.. I set up Google Webmaster tools in early March and went live with the new site on 2nd April. Since the 6th April (4 days after going live) I've notice a drop in impressions from 15,000 - 28,000 per day to 3,500 - 5,500 per day. Now I'm kind of new to this, so after I cleaned up after my initial panic, I checked impressions vs. clicks. Impression are down 44% and clicks 31%. Not bad I thought but then again what if I dropped so far off the radar I never made an impression. 1. So first question: Are the number of impressions of a keyword independant of ranking. So if I rank #3,445,234th will I still see impressions listed but avg. position reflect #3,445,234? So while I was thinking of asking these questions I checked Google Analytics for which I have just over 3 years of metrics. Compared to the past; overall traffic and organic traffic are the same if not 10-20% better. 2. So second: Am I missing something? Its a resort website so easter just ended and you would expect the traffic to match and drop, but such a sudden and dramitic drop in Webmaster Tools impressions does not match Google Analytics. Infact Organic traffic climbed slightly. Can anyone offer any insight? Thanks, Adam
Reporting & Analytics | | NaescentAdam0 -
Creating a Filter in GA to track Parent Category
I don't know if the title makes sense, but here's my question... Our newspaper website has multiple categories like World, Sport, Entertainment etc. Now, a story, belonging to the entertainment section maybe published on the entertainment page but is likely to have a slot somewhere on the Home page as well as other pages. The same goes for stories in sport etc. However, the url displays the date folllowed by the post title and thats it, no category name. Now, a user may end up going to a detailed story that belongs to the entertainment section (from the home page or any other page) without actually having visited the entertainment page. However, for tracking purposes, we want to see how many hits we got on the entertainment page and any story belonging to that particular section. So, my question is how do I go about creating filters that can help me track category page and detail story hits as one? Or, should I ammend the url structure (keep in mind we are using wordpress for our news website) to include category after the date and would this solve my problem of tracking? I asked a similar question recently but maybe I did not explain myself clearly. Thanks!
Reporting & Analytics | | RishadShaikh590