3

I have two goals setup in Google Analytics - a subscription order and a one time order. Both goto the same thank you page put produce different parameters. Using the regular expression option in the drop down, how can I match the following?

One time order (the random numbers and letters are variable):

https://www.example.com/thanks/?o=85710&key=wc_order_37ztwgrjSBGqK&type=onetime

Subscription (the random numbers and letters are variable):

https://www.example.com/thanks/?o=9670&g=stripe

2
  • Are there any parameters, that should not qualify as a goal? E.g. type=other. Or basically any /thanks/ visits count as a goal?
    – kgrg
    Commented Sep 11, 2019 at 10:37
  • using regular expression you can use the | operator. Example : (a|b) Matches the a or the b part of the subexpression.
    – pjmg
    Commented Sep 11, 2019 at 15:40

1 Answer 1

1

You can split these out as two separate goals if there is some identifying feature of each version of the thank you page URL that is not present in the other.

From your examples it looks like type=onetime and g=stripe distinguish the versions of the URL. Assuming that's true and allowing "stripe" to vary, here are regular expressions you can use:

One-time: ^/thanks/.*[?&]type=onetime

Subscription: ^/thanks/.*[?&]g=

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.