Analytics
3.1K members online now
3.1K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Matching URLs that vary in the middle

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hey, I'm really stuck trying to create a funnel that matches URLs which vary in the middle, for example:

 

website.com/projects/12345/edit

website.com/projects/12345/preview

 

For each user and for each project the numbers part will vary. So I'm trying to track something like:

 

website.com/projects/*/edit

website.com/projects/*/preview

 

...so as to only track the consistent parts of the URL. How can I do this properly?? It's driving me crazy!

 

Thanks,

 

D.

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Diarmuid M
December 2015

Re: Matching URLs that vary in the middle

Top Contributor
# 3
Top Contributor
Hi Diarmuid,

You need to use a regex like these:

website.com/projects/[0-9]*/edit
website.com/projects/[0-9]*/preview

Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Re: Matching URLs that vary in the middle

Top Contributor
# 2
Top Contributor
Hi Diarmuid,

take regular-expression setting with

^/projects/[0-9]+/edit$
^/projects/[0-9]+/preview$

Hope this helps.

Christoph
Marked as Best Answer.
Solution
Accepted by topic author Diarmuid M
December 2015

Re: Matching URLs that vary in the middle

Top Contributor
# 3
Top Contributor
Hi Diarmuid,

You need to use a regex like these:

website.com/projects/[0-9]*/edit
website.com/projects/[0-9]*/preview

Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Matching URLs that vary in the middle

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Brilliant Christoph, thank you very much. I'll try that now.

Re: Matching URLs that vary in the middle

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Also brilliant Arnold, much appreciated. Going to try.

Re: Matching URLs that vary in the middle

Top Contributor
# 6
Top Contributor

@Arnold M Generally the domain isn't included in page urls (unless added by a view filter). One should use the "+" here instead of "*" to avoid zero occurances of the digits.

Re: Matching URLs that vary in the middle

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
@webfield do you mean to avoid a situation where there are no digits whatsoever? By the way, it's working - thanks so much!

Re: Matching URLs that vary in the middle

Top Contributor
# 8
Top Contributor
Thanks Christoph, I assumed that the examples from the OP are from his reports and he has the domain included in the page URLs.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Matching URLs that vary in the middle

Top Contributor
# 9
Top Contributor
Hi Diarmuid,

no, just assuming that there are always some digits in between, the regex with "+" (means 1 or more occurrences of the character type before) is a bit tighter.

You can always test a regular expression for page URLs in the "All Pages" report: Just enter the regex into the small filter field above the table for testing.

So, which regex is actually working now?

Christoph

Re: Matching URLs that vary in the middle

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
Thanks Christoph, that's great. They're actually both working, so I guess it's better to go with the tighter option you described.

I appreciate all the help guys,

Diarmuid