When you track conversions in Google Analytics, you’re really tracking the content that loads after the conversion occurs, which is typically some sort of success, confirmation or thank you message.
Most of the time that content loads in a new page. Sometimes it’s an inline message, but that’s the exception – and a topic for another post. So, for now, we’re going to assume that the success message is on a new page.
In Google analytics parlance, a conversion is a “destination goal” and that thank you page is the destination part of the equation. So, in simple terms, we just need to tell Google to count any views of that page as a conversion.
Setting that up is a pretty straightforward process if your success page is static and there are no variables in the URL (e.g. /thankyou.html without any kind of ‘?=abc123xyz,’ after the ‘.html’). That’s a simple “equals to” match. To do this, simply go to admin, click ‘Goals’ in the ‘View ‘ column, then ‘new goal.’ Then on the next page, select the type of goal and paste in the destination URL.
But when there are session variables in the URL, “equals to” won’t work because each session has a unique URL. If the variable always trails a fixed directory, e.g. /checkout.cgi?page=1&id=123456789, you can use “begins with” and enter /checkout.cgi?page=1 as the URL. Maybe not as straighforward as a static URL, If you’re lucky, the variable is consistent so you have to identify the pattern that the URL follows, and ‘describe’ that pattern to GA by combining normal characters and special characters (aka meta-characters) using pattern matching. Good times, right?!
Since I’m already running long, I’ll just point you here so you can learn all about using RegEx in GA: https://online-metrics.com/regular-expressions/