Regular expression (regex) Google Analytics question

by jojoma
1 replies
Hi, I'm struggling with this. I am trying to create a regex within a Goal that includes any URL that has utm_source=google

Here is an example of what the full urls looks like.
dubdubdubdoturldotkom/?utm_source=google&utm_medium=bn&utm_campaign=cg
dubdubdubdoturldotkom/?utm_source=google&utm_medium=bc&utm_campaign=ch

Could I do something like this?
*/\?utm_source=google*

Thanks a lot!
#analytics #expression #google #question #regex #regular
  • Profile picture of the author Will Edwards
    Hi There

    I thought I'd try to help a bit.

    The * character does not work quite as you might imagine in a regular expression. As I recall, it basically means 'any number of the previous char'.

    The . means what you would probably think the question mark means i.e. 'any char'. The combination i.e. .* is probably what you are after. So try:

    .*utm_source=google.*

    Cheers,

    Will
    {{ DiscussionBoard.errors[4463869].message }}

Trending Topics