Analytics
2.1K members online now
2.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

Regular Expressions when implementing Goals

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi Guys,

Could anyone of you please help me implement these different goals URL's using Regex?

 

1./how-not-to-have-educational-breakouts.html

2./this-changes-everything-we-know-about-education.html

3./she-never-had-studying-outbreak-after-doing-this.html

 

I would just like to cross-check whether I've done it correctly using Pipe and Bracket Expression.

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Sushrut V
May

Regular Expressions when implementing Goals

Top Contributor
# 4
Top Contributor

Hi,

 

The syntax from my post should work fine in GA. Hyphens have no special meaning outside character classes (square brackets), so there is no need to escape them. The dot matches any one character, including a dot, so there is no need to escape it either.


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

Regular Expressions when implementing Goals

Top Contributor
# 2
Top Contributor

Hi,

 

Please try:

 

^/(how-not-to-have-educational-breakouts|this-changes-everything-we-know-about-education|she-never-had-studying-outbreak-after-doing-this).html$

 

Let me know if it worked


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

Regular Expressions when implementing Goals

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Arnold,

Shouldn't it be something like this?

^/(how-not-to-have-educational-breakouts|this-changes-everything-we-know-about-education|she-never-had-studying-outbreak-after-doing-this)\.html$

 

Also, do we have to include forward slash every time before a hyphen? Does the below expression work?

 

For eg: ^/(how\-not\-to\-have\-educational\-breakouts|this\-changes\-everything\-we\-know\-about\-education|she\-never\-had\-studying\-outbreak\-after\-doing\-this)\.html$

 

Correct me if I'm wrong. Thank You!

 

 

Marked as Best Answer.
Solution
Accepted by topic author Sushrut V
May

Regular Expressions when implementing Goals

Top Contributor
# 4
Top Contributor

Hi,

 

The syntax from my post should work fine in GA. Hyphens have no special meaning outside character classes (square brackets), so there is no need to escape them. The dot matches any one character, including a dot, so there is no need to escape it either.


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

Regular Expressions when implementing Goals

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thank you so much Smiley Happy