Comments on: The Ultimate Guide to Master Regular Expressions in Google Analytics https://online-metrics.com/regular-expressions/ Google Analytics Courses and Consulting Mon, 19 Jan 2026 14:25:34 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Paul Koks https://online-metrics.com/regular-expressions/#comment-69002 Mon, 20 Jun 2022 12:13:26 +0000 https://online-metrics.com/?p=6656#comment-69002 In reply to mohi.

Hi Mohi,

In that case you would probably need the help of a developer to write a code/rule that all news posts are automatically tracked in a “news” content group.

This is very challenging to achieve with a simple RegEx rule as you already mention.

Best,
Paul

]]>
By: mohi https://online-metrics.com/regular-expressions/#comment-68899 Wed, 15 Jun 2022 11:44:10 +0000 https://online-metrics.com/?p=6656#comment-68899 I need to track my news in one specific category. what I have problem with, is that the post on that category doesn’t have regex. this is my main category :domain.com/category/market/news. this is one example:
https://tejaratnews.com/category/%d8%a8%d8%a7%d8%b2%d8%a7%d8%b1/%d8%a8%d9%88%d8%b1%d8%b3
but this is my posts url sample: domain.com/poet-title
How can track traffic volume of all my posts of that specific category?

]]>
By: Paul Koks https://online-metrics.com/regular-expressions/#comment-56295 Mon, 12 Apr 2021 13:21:51 +0000 https://online-metrics.com/?p=6656#comment-56295 In reply to Pieter.

Hi Pieter,
This should work for you:
\/apply\?&step=1

Best,
Paul

]]>
By: Pieter https://online-metrics.com/regular-expressions/#comment-56290 Mon, 12 Apr 2021 08:23:17 +0000 https://online-metrics.com/?p=6656#comment-56290 Hi Paul, I’m trying to set up a Goal in Google Analytics using Regular expression. It’s part of an application funnel that contains 4 steps where the end of the URL equals /apply?&step=1. Where 1 is the first step and 4 the confirmation page. I’ve been trying to make it work but without succes (yet). How should I write this? Can anyone point me to the right direction?

]]>
By: Paul Koks https://online-metrics.com/regular-expressions/#comment-51781 Mon, 12 Oct 2020 12:21:21 +0000 https://online-metrics.com/?p=6656#comment-51781 In reply to Simon Pointer.

Hi Simon,

Great to hear from you and thank you for the heads up and suggestion!

I think this one will also work in your case (to go for “exact” match):
^(London|Glasgow|New York|Paris)$

By using “()” I group all cities together, “^” defines the starting point and “$” defines the end point.

Best,
Paul

]]>
By: Simon Pointer https://online-metrics.com/regular-expressions/#comment-51709 Fri, 09 Oct 2020 16:35:05 +0000 https://online-metrics.com/?p=6656#comment-51709 Hi Paul. Great post – thanks. I have been using it for ages as the best GA specific resource for Regex when I train GA training courses. I wanted to request an addition perhaps?:
I often do a regex example using geo data to return a table of multiple cities, something like – London|Glasgow|New York|Paris and it works a treat bar one key issue:

The match pattern is effectively: contains London OR contains Glasgow OR contains New York etc etc. The problem is for cities like London I will also get Londonderry, New London, East London etc and this kind of defeats the object of trying to Isolate these specific cities in the first place.
I have looked for a solution for a little while for exactly London OR exactly Paris OR exactly Other city, but of course you can’t just do “London” | “Paris” or even (London) or ‘London’ or \London\ or [London] or {London} because these regex characters don’t do exact match on a string and doing that seems quite hard.

Today I found a nice solution on one of google’s own support pages for work space admins and it works a treat for this so thought I’d share it here as it might help out other people too.

(\W|^)London(\W|$)|Glasgow|New York|Paris|Milan

]]>
By: Paul Koks https://online-metrics.com/regular-expressions/#comment-51010 Fri, 21 Aug 2020 13:38:05 +0000 https://online-metrics.com/?p=6656#comment-51010 In reply to AS.

Happy to help :-)

]]>
By: AS https://online-metrics.com/regular-expressions/#comment-51009 Fri, 21 Aug 2020 13:37:09 +0000 https://online-metrics.com/?p=6656#comment-51009 In reply to Paul Koks.

Noted Paul :-)

Thanks again !

]]>
By: Paul Koks https://online-metrics.com/regular-expressions/#comment-51008 Fri, 21 Aug 2020 13:35:11 +0000 https://online-metrics.com/?p=6656#comment-51008 In reply to AS.

Glad to hear that it works. One last tip: you can try out the RegEx within the “All Pages” section to see if it works (based on historical data of visited pages).

]]>
By: AS https://online-metrics.com/regular-expressions/#comment-51007 Fri, 21 Aug 2020 12:54:52 +0000 https://online-metrics.com/?p=6656#comment-51007 Thanks Paul its working, its taking some time to reflect..

Thank you so much..

]]>