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
-
Domain change from .co.uk to .com - do you add .com to the referral exclusion in GA?
Hi Mozzers, Just wanted to double check that when a website domain changes from .co.uk to .com - do you add .com to the referral exclusion in GA? Do you also keep the .co.uk version in the list too? I have updated the property settings to .com Thanks Anthony
Reporting & Analytics | | Tone_Agency0 -
Is it possible to have a GA event and a GA virtual pageview fire off of the same click?
If we can only choose one, we'll likely go with the Event, but I'm hoping we'll be able to do both and gather more data about when certain pages (even if they are virtual) are viewed in the path to conversion.
Reporting & Analytics | | KNect3650 -
Why do WMT's Search Analytics & GA's Real Time Keywords Differ?
I took a screen shot of the keywords from Google Analytics Real Time Keywords for Google / Organic. Then I waited a week and filtered Google Webmaster Tools' Search Analytics for queries with those keywords. None of them showed up. Why not? What I missing? Why do some keywords show up in Google Analytics RT for Google / Organic while most others are in Not Provided? I see WMT's Search Analytics says that it doesn't always show queries that "are made a very small number of times or those that contain personal or sensitive information." But most of my queries are like that. Anybody know any patterns / criteria that leads WMT to show some but not others? Thanks
Reporting & Analytics | | GilReich0 -
Question about setting up Google Webmaster on Network Solutions?
I'm trying to set myself up as a Webmaster on my company's site. We use Network Solutions. I am following Google's directions on how to do this. However, I am a bit wary. Here are the directions. Underlined is the part I am having trouble with: Log in to your account for howlatthemoon.com at www.networksolutions.com by clicking theManage Account icon. In the left navigation bar, open the nsWebAddress (Domains) menu by clicking the **+ **icon. Click Manage Domain Names. On the Domain Details page for the domain you're using, select the Designated DNS radio button (to the right of Change domain to point to) and click the Apply Changes button. If you've previously modified your advanced DNS settings, click Edit (to the right ofDomain currently points to). Under the Advanced DNS Manager heading, click Manage Advanced DNS Records. Under the Text (TXT Records) heading, click Add/Edit. In the Host field, enter @. Leave the TTL field set to the default value. In the Text field, copy and paste the following unique security token:
Reporting & Analytics | | howlusa
(security token removed for obvious reasons) Click Continue. Review your changes and click Save Changes. When you've done saving the TXT record, click the Verify button below on this page. There is already a host of @ (None). The text for it reads: v=spf1 include:_spf.google.com ~all I called Network Solutions and the guy I was speaking with told me to delete it and replace it with my Google Webmasters code. However, I think this is setting up our email. Do I just add the Webmasters in and have two hosts of @ (None)? Thanks!0 -
Google Analytics Custom Filter
Hello, Quick question, when I create a custom filter on a profile that already has data collected will that filter apply to already collected data or will the filter only apply from the day it was created? Am doing a custom exclude IP filter. Much thanks,
Reporting & Analytics | | Unity
Davinia0 -
Google Custom Report Filters are a pain in the arse
Greetings from high weed pollen count Wetherby UK 🙂 Ok ive been having extreme custom reporting filter frustration with Google analytics. My objective was to set up a "custom" google analytics report that detailed: 1. Referral traffic from external sights in one reporting tab
Reporting & Analytics | | Nightwing
2. Visitor generic traffic report including direct, search & referral traffic e.g: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/reporting-tabscopy.jpg But Ive hit the provebial buffers 😞 Initailly i added an advanced filter as shown here: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/custom-reporting-with-filtercopy.jpg but the advanced filters do not stick / save. As soon as you exit the custom report the advanced filter is cleared as shown here: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/custom-reporting-filter-removedcopy.jpg I then added a filter under a specific custom tab but the filter cascades into all the reporting tabs see below: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/custom-reporting-cascading-filterscopy.jpg So my question is please... "How do can you set up filters that effect the data in one reporting tab and does not cascade into the others" Any insights welcome 🙂0 -
New GA interface - Number of conversion by source
Hi Guys, Hope this is an easy one for a GA ninja. In the new GA interface, how can I view the number of conversions by source, instead of the default conversion rate by source. For example, if I want to view the number of conversion from Adwords. I'm looking at Goals > Source / Medium > Google CPC and looking at Goal Set 1. However all data is expressed in percentages. Thanks in advance!
Reporting & Analytics | | David_ODonnell0 -
Site: Query Question
Hi All, Question around the site: query you can execute on Google for example. Now I know it has lots of inaccuracies, but I like to keep a high level sight of it over time. I was using it to also try and get a high level view of how many product pages were indexed vs. the total number of pages. What is interesting is when I do a site: query for say www.newark.com I get ~748,000 results returned. When I do a query for www.newark.com "/dp/" I get ~845,000 results returned. Either I am doing something stupid or these numbers are completely backwards? Any thoughts? Thanks, Ben
Reporting & Analytics | | BenRush0