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
-
Hi John, thanks a lot for your reply... what I am actually after is two patterns rather than two url instances., eg:
/japan-english-* meaning all urls that follow that pattern
/en/japan-english-* meaning all urls (in English) that follow that pattern
so I have now got this on my filter pattern: /japan-english-
I hope it'll work both for the urls in English and in Japanese, I will post the results here,
cheers
david
-
The ^ character makes it so your expression only matches the beginning of the request URIs. If you remove it, all URLs with /japan-english will get picked up. That sounds like it should work for you.
If you really just want those two instances, you can include both and separate them with a | which acts as "or" in regular expressions.
There's a nice guide for using regular expressions in GA at http://www.ppchero.com/analytics-regular-expression-characters/ if you want to read more about them.
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
-
Help me exclude our dynamic IP addresses from GA
Hi There, I can't believe we are the first SEO Web Development company with the issue of dynamic IP addresses, for technical reasons our ISP keeps changing our IP addresses to different random IP addresses (no patterns, ranges, or reasoning to the specific changes) and we obviously need to exclude our own visits to google analytics - but I can't seem to find any simple way to do this in Google Analytics - can you help me find a simple solution for this? I did find two chrome extensions(I'll give you the links to those at the end) that I will look into if you cant help me find a simpler solution 🙂 Thanks so much!! https://chrome.google.com/webstore/detail/block-yourself-from-analy/fadgflmigmogfionelcpalhohefbnehm?hl=en https://chrome.google.com/webstore/detail/developer-cookie/lknhpplgahpbindnnocglcjonpahfikn
Reporting & Analytics | | Ruchy1 -
Does applying filters in Google Analytics affect Moz Data?
Hello, I'm dealing with spam in google analytics, applying filters (and using segments for historical data) Does applying a filter in GA affect Moz data, future or historical? Is there a way of doing this? Thank you!
Reporting & Analytics | | wearehappymedia0 -
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 -
Some questions on how to set up a multi-visit advanced segment in Google Analytics
Hi I would like some assistance / clarification on how to set up a user segment so that it can track user behavior over multiple visits. Basically I have a campaign set up and want to see conversions - even if they hit the site and then convert later on another visit. I've read that you can do this (over up to 30 days). So I start off by filtering TRAFFIC SOURCE - easy enough. But then I have to add under "advanced" correct? But then when I set the next filter to the GOAL I want, I only get "by session" and "by hit" as options. The blog post I read made it sound like only "by user" would then really do multi visits. Is "by user" only an e-commerce tracking option? (which I don't have set up) Is there another way/path to get the info I need? Thank you!
Reporting & Analytics | | yandl0 -
Our SEO is garbage. can someone answer a few questions for me?
I've seen our SEO drop to more or less the bottom of the barrel, and I don't have any answers yet as to why. SEOMoz is running it's crawl currently, and I have a few errors about duplicate titles and content, so I know I have some work cut out for me. But, why the sudden drop? The only change I made at the time was a change to our URL structure, but all links were 301'd to their new location. Does this still hurt SEO that terribly? Also, our robots.txt file is getting indexed and showing up as the first result at times. Very embarrassing. It's doing better than our other pages. 😞 I don't get what's happening here. Yrzu3,fkbYu
Reporting & Analytics | | stagl0 -
How to filter pages in Analytics by multiple criteria
Hello, we have several pages with the same page title. Now out of all those pages I want to pick two. Let's call them "/page1" and "/page2". For those pages I want the following information (combined for both): Avg. time on page, Bounce rate, Navigation Summary Normally I get all the information under "Content" "Pages" and by choosing the "page title" as primary dimension and clicking on the respective page title. Let's call it "page | title". Choosing the filter for 1 page works fine (I just enter "/page1" in simple filter). But how can I filter for two pages ( entering " include page ends with /page1 and include page ends with /page2" in the advance filter will show 0 results). Thanks in advance
Reporting & Analytics | | guitarslinger0 -
Google Analytics session update question
Hello, With reference to seomoz blog post - http://www.seomoz.org/blog/panda-24-and-analytics-session-update-rolled-out-simultaneously#jtc151292 , i would like clarification about the following - User searches Google for "Product Name" and clicks on your AdWords advertisement. User leaves site and searches a few more times, click on competition and comparing prices and features. User ultimately decides to with your product, Googles "Your Brand + Product Name", clicks your organic listing, and buys the product. This whole process takes less than 30 minutes. "Your Brand + Product Name" will appear in your organic keyword report with 1 visit. My question is whether "Product Name" will also appear in organic keyword report with 1 visit if the visitor is not signed in. ( as search won't be encrypted ) Thanks
Reporting & Analytics | | seoug_20100 -
Analytics goal funnel regular expression not working
Hi Guys can anyone point me in the right direction. My funnels used to work fine until our app team decided to add variables in a directory structure instead of a query string. I need to be able to track page steps that now look like this Step 1 = /Reservation/Search/Var1/Var2
Reporting & Analytics | | apolloseo
Step 2 = /Reservation/Quote/Var1/Var2 I've set up this but it's not working Step 1 = /Reservation/Search.*
Step 2 = /Reservation/Quote.* What am I doing wrong?0