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
-
Excluding Cookieless Static Content Sub-domain from GA/GTM
For the purposes of this question our ecommerce site url is www.ecommerce.com Our TLD is ecommerce.com We have, following advice from Yslow, Pagespeed and others, moved our static content to a subdomain - static.ecommerce.com We have Google Analytics and Enhance Ecommerce installed, fired from GTM. The cookieDomain setting in GTM is 'auto' At present cookies are being attached to our static resources. What changes do I need to make to to prevent this happening? Many thanks Julian
Reporting & Analytics | | jdeb0 -
Big discrepancy between GA an GSC
Hey! I would really appreciate if someone could help me on this 🙂 I have a website with separate mobile and desktop versions, on GSC I see a huge drop in the number of clicks on the mobile website and an increase in the number of clicks on the desktop website, however this isn't reflected at all in GA. GA shows that mobile traffic hasn't increased for any version of the website and the webpages losing traffic according to GSC are flat/growing on GA (even if I look at traffic coming from organic only). Has anyone experienced something similar or has any possible explanation? Thanks!
Reporting & Analytics | | Anna_90 -
Days to transaction - GA
Hi We have noticed a trend with days to transaction being high for May - June for Organic for 28+ days. Does anyone have any helpful articles or ideas on why this is happening for organic?
Reporting & Analytics | | BeckyKey0 -
Filter staff IP address in Analytics
Hi, I'm trying to filter staff visits from Analytics on a new view. IT have given me an IP address range and I have found the following advice: "For an IP address range, you’ll have to select Custom Filters, then choose Exclude, and IP Address from the dropdown list. Then, enter a regular expression for the IP Address" If this is correct, how do I write the IP address range 1xx.xxx.xxx.160 - 1xx.xxx.xxx.223 in RegEx? Thanks
Reporting & Analytics | | Houses0 -
Analiytics question
Hello guys, We are currently getting in our website around 600 daily visitors.
Reporting & Analytics | | WayneRooney
We getting around the 50 quotes a day.
Can i know trough Analytics from where all the visitors that click the quote button coming from ? Thank you0 -
Regex Filter To Exlude lower case urls
Buon Pormeriggio from Wetherby 22 degrees the summer continues! I need to set up a regex filter to knock out lowecase versions of http://www.sandersonweatherall.co.uk/Sales/ Thing is Analytics is returning this lowercase version which i want to regex filter out.So if Regex filter /Sales/$ returns what i eant how do i knock out urls beginning with lowe case s. Grazie,
Reporting & Analytics | | Nightwing
David0 -
GA not recording visitors PART 2
Further to my question yesterday where all data for Wednesday 31st July 2013 was not showing - the data did reappear yesterday afternoon. But today, all data for yesterday seems odd - across all my projects visitor numbers appear to be around 40% down on the norm. Sales were normal, so I wonder if this is another glitch - anyone else seeing strange stats in GA for yesterday?
Reporting & Analytics | | FDFPres0 -
Since the 6th June there has been a serious drop in search impressions and clickthroughs in my GA + webmaster accounts.
Since the 6th June there has been a serious drop in organic search impressions and click throughs in my GA + webmaster accounts for my website. This leads me to believe my site has been punished for something? Where would be the best place to start diagnosing the issue causing the drop in search traffic? 2T9hz.jpg
Reporting & Analytics | | Scurrypoint0