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
-
Tracking goals on a subdomain with traffic coming from main domain subfolders. Mission Impossible?
Hello guys, I'm facing a huge challenge setting my goals. Here is the situation. I'm having the same Universal Analytics code on my main domain with different languages www.example.com/en/, www.examples.com/fr/, etc and my www.shop.example.com subdomain. So a French user will go to www.example.com/fr/, see a product that want's to buy and after the registration will see a thank you page on www.shop.example.com/success.html, and here comes the problem. My goal URLs are not "fired" with my filter. I have set up a filter (attached) to include traffic only for the desired profiles, but when this filter is on I can't see conversions. When the filter is off I can see conversions but for all languages. Any ideas how to set up the filter properly? Thank you! Filter.png
Reporting & Analytics | | peternachevat0 -
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 -
Universal cookie loss specific traffic
Hi there, A month ago we have installed the Universal Analytics tracking code on our website (www.smartphonehoesjes.nl). Since that time, direct traffic has risen unnaturally and organic traffic dropped unnaturally. I dived into this problem and I discovered there is a cookie loss on when visitors are switching from /cart to the first step checking out. The problem is that not all browsers cause these cookie issues, only Safari and IE older versions (9 and older) and some cases of Chrome. All iPads cause cookie issues (50% of all cases). iPhones cause not a single problem because we are using a separate mobile (m.) site which does not cause cookie problems. We don't have a mobile site for tablets yet, soon it will come. My biggest question is: how can I fix the Safari desktop cookie loss after switching domains from /cart to the first step of the chckout process? Olders versions of IE will slowly fade out and the iPad problem will be fixed when the mobile website is available for tablets. I hope someone can help me.
Reporting & Analytics | | MarcelMoz
Thanks in advance. Marcel0 -
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 -
Will 301 redirects (Same Domain) show as referral traffic in Analytics?
For an eCommerce site we have 301'd legacy product pages to new product pages. Is all that traffic going to show up as referral traffic from our own domain in Google Analytics? If so, is there any way to preserve original source/medium info or will all the source/medium info be our own domain since there is a 301 redirect?
Reporting & Analytics | | bozzie3111 -
GA stopped tracking traffic, suddenly, why¿? :-/
2 days ago GA stopped receiving data. It only stopped for one account of all my projects. At this moment there are 5 persons navigating the site and these days there where numerous visitors as they contacted the support team thru the site. GA says that it's receiving the code, hw, I checked it twice. The tracking code is located below the footer, in the body. It was there for few years.... I also checked if there is some js conflict, negative. Is there something that could make the tracking to stop? Does anybody experienced similar problems¿? Should I be worried...¿? (and with SEOmoz server with issues not sure when will see new results.......) EDIT: In Web Master Tools I see results for indexing, with yesterday date, so I assume that the site crawling is ok and must be GA issue.
Reporting & Analytics | | MilosMilcom0 -
How Can I Record .zip Traffic in Google Analytics
The company I am with shows traffic coming in to .zip files in Google Analytics. The traffic being recorded stopped a while back, but I know people are still downloading/visiting these .zip ULRs. I'm not sure how they were recording/tracking the .zip URLs (in Analytics) before, but I'd like to track them once again. Does anyone know how to do this? Thanks
Reporting & Analytics | | poolguy0 -
Subdomains and SEO - Analytics & Webmaster Tools Setup Help
Any advice on the following greatly appreciated: How to get multiple subdomain data into 1 Google Analytics profile? Can we get multiple subdomain data into Google Webmaster Tools (and if so how?) or do we need to set GWT up per subdomain?
Reporting & Analytics | | AndyMacLean0