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

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

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.



Step 1:


Step 2:


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):


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.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.