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
-
Scary Traffic Drop — Slower at First, Now Much Sharper
Hi. My website, dailytekk.com, has been steadily losing viewers since April. In recent weeks, though, the drop has been much more significant — scarily so. Almost all our traffic comes from Google, organically. In the last 30 days I've lost 135k page views. I'm not sure if we just have content that is getting old, if Google changed something in the algorithm, if we are being penalized, if AMP pages are having a negative effect, etc. I would love to find a great consultant to help us figure this out and get back on the right track. We seem to be losing traffic despite our best efforts at this point. Thanks, Chris
Reporting & Analytics | | dailytekk0 -
How to filter out client traffic
Hi, I would like to filter out traffic in GA that comes to my client site just to login into their application. Is there a way to create a filter or segment that if a visitor exits the site to a subdomain it will filter them out? For example, they land on the homepage (abc.com/), click the login tab (drop down screen) and login and go to their application dashboard (app.abc.com/). I would like to delete this traffic segment as it is creates high bounce rates and makes it difficult to test landing pages. Thanks so much, Donna 🙂
Reporting & Analytics | | WebMarketingHUB0 -
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 -
How to see organic traffic only?
Im having trouble separating our organic traffic vs our PPC. When I go into Analytics>Traffic>Sources>Search>Organic, its giving me numbers that are not accurate. I believe whats happening is that its not able to distinguish our bing organic/ppc. Is using Webmaster tools Search Queries a more accurate way to determine organic search volume?
Reporting & Analytics | | DemiGR0 -
What will you do when seeing the rank and traffic are dropping?
No black-hat SEO strategy was adopted, so we suppose it's not a penalty, but ranks and organic traffics are dropping. What will you do in this situation? And how long it takes for you to make sure it's not a normal flux, but something wrong happens on your site? Thanks in advance
Reporting & Analytics | | JonnyGreenwood0 -
Anyone using Webtrekk?
For months now we have experienced major frustrations with Google's way of running and measuring traffic and providing analytical information. Although our measuring and segmentation requirements are not unique (I would heavily digress if I describe it) we established with Google Analytics engineers in engagements for more than 2 months, that GA is incapable measuring the traffic we require. The few products I came across which are capable of providing proper segmentation based on product categories are Kissmetrics (unfortunately not a all-in-one analytics tool), Webtrends (horribly expensive) and I just recently stumbled across Webtrekk (http://www.webtrekk.com/en/products/q3.html). I was wondering if anyone is using or has used Webtrekk and would be able to share some experience (and how it compares to GA and Webtrends).
Reporting & Analytics | | MagicDude4Eva0 -
Question on regular expression for filters on GA
Hi guys, I am creating profiles on some of the countries sites in my network, and have managed to establish the filter for tracking certain url patterns, for example: ^/japan-english- is tracking all my urls in the Japan site that start by japan-english great! however, it is not tracking the japanese instance of the urls. The pattern for the latter is : www.mysite.org/jp/japan-english I could then modify the filter to track the jp subfolder like this: ^/jp/japan-english- but it will then only track the urls on the /jp/ subfolder does anyone know the regex command for tracking the two url patters as follows: /jp/japan-english- & /japan-english- thanks in advance david
Reporting & Analytics | | BritishCouncil0 -
Disclaimer about using Google Analytic?
When using GA on my Website do I need to have a disclaimer that 'We are using Google Analtyic to Track information'?
Reporting & Analytics | | daracreative0