AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
5.1K members online now
5.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

Using Regular Expressions for GA goals & Funnel pages

Google Employee
# 1
Google Employee

This popular discussion was copied from the former Help Forum, answered by Zorin Radovancevic (RS)

 

Question: I am trying to figure out how to tell GA how to include 2 parts of a URL, while ignoring variable elements in the middle of the URL.

 

Example:

Step 1:

http://www.myurl.org/enrollment-tool/?cell=3334445555&email=cltesting23@test.com&last_name=testing&f...

 

Step 2:

http://www.myurl.org/enrollment-tool/?cell=3334445555&email=cltesting23@test.com&last_name=testing&f...

 

How do i distinguish Step 1 as the 'quickQuestions' step, and Step 2 as the 'createAccount' step. I am thinking that I need to use Regex to tell GA to look for /enrollment-tool plus quickQuestions. 

 

Do I need to use regex in this case above, or something else?

 

Answer1st thing you need to solve is the values you are passing to Google analytics in the page dimension which are explicitly not allowed such as (bold):

 

http://www.myurl.org/enrollment-tool/?cell=3334445555&email=cltesting23@test.com&last_name=testing&first_name=cl#/quickQuestions

 

You have to exclude these query params in the view settings (cell,email,last_name,first_name)!

 

2nd If you want to create goals inside GA based on the hash part of the URL you would need to override the default page value when sending a pageview and edit it to pass location.pathname + location.search + location.hash.


So your 1st step would be match regex 'enrollment-tool.*quickQuestion'  and your 2 nd step in the funnel would be  'enrollment-tool.*createAccount'.

1 Expert replyverified_user

Re: Using Regular Expressions for GA goals & Funnel pages

Google Employee
# 2
Google Employee
If you have any questions, post them below, or start a new discussion.