Creating Google Analytics Goals: “Equals to” or “Begins with” or “Regular expression”?

Goole Analytics GoalsWhich should I use? That is the central question when considering Google Analytics Goals. Goals in Google Analytics (GA) supplies three different match types to use in the Goal details. The three different match types are:

  1. Equals to
  2. Begins with
  3. Regular expression (regex)

the details of setting Google Analytics Goals

When we select the type of Goal to be Destination or Event, we must choose a match type and provide a URL as a value, This is called a Goal URI or Funnel URI. A match type defines how GA identifies a URL (visited by a user) for either a goal or a funnel step. A URI or page path is the part of the URL that comes after the domain name.

For example, if the URL is then the request URI would be /contact-us/

GA identifies visits to the URL page by matching the Goal URI with the request URI. If both match, then it means the Goal URI page was visited. Something to remember is that the match type we select for the Google Analytics Goal URI will also apply to all Funnel URIs.

Google Analytics Goals allow you to track specific visitor interactions on our website. Click To Tweet

“Equals to” match type

An “Equals to” match type needs to match the Goal URI precisely with the request URI. If there is any difference, the Goal will not be triggered. For example, if the Goal URI is /contact-us/ and the request URI is /contact-us/xyz, this is not an exact match, and the Goal will not be triggered.

“Begins with” match type

We use the “Begins with” match type if we want to only match the first part of the Goal URI with the request URIs. For example, if the Goal URI is /contact-us/ and the request URI is any of these:


–The Goal URI would match all the request URIs above, and the Goal will be triggered.

“Regular expression” match type

When creating Google Analytics goals, the “Regular expression” match type is the best match type to use. This type provides flexibility when it comes to matching Goal URI and Funnel URIs with their corresponding request URI. However, it could not be effortless to implement if we do not understand how they work.

What is regex when setting Google Analytics Goals?

Regular expressions, aka regex, give a powerful and flexible technique to specify what a pattern should look like by using a combination of letters, numbers, and special characters. You can use regex in your Google Analytics goals regular expressions to find anything that matches a pattern. For example, we can find all pages with a query string more than five characters long.

Regex uses a series of special characters that carry specific meanings. This is a not complete list of the special characters in regex that give a non-literal sense.

^ $ . ? [] () + \


The regex matches the pattern you specify if they occur anywhere in the string—beginning, middle, or end. There are anchors you can use in a regex to specify that a pattern should only happen at the beginning or end.

The caret symbol (^) is used to anchor a pattern to the beginning, as shown in this example:

^/page will match “/pages.html”, “/page/location.php”, and “/page-to-find”. It would not match “/location/page.html” or “/pag/e.html”.

A dollar sign ($) is used to anchor a pattern to the end, as shown below:

html$ will match “/home.html”, “/contact-us/form.html” and “/html”, but not “/html/site.php”, “/home.htm” or “/location.html?loc=florida”.

We can use both (^) and ($) as in a ^contact-us$, which will only match “contact-us” and ^$ will match only empty strings. It is important to remember that the caret (^) should always be to the left of the dollar sign ($).

Ranges of Characters in Your Google Analytics Goals

Regex can be used to match ranges or combinations of characters.

The square brackets ([]) allow you to specify a variety of characters that can appear in a particular position in the string. Square brackets look at each character, not whole words. The square brackets ([]) are used to match a combination of characters, [aeiou], or a range of characters with a hyphen, [a-z]. Example of this are:

[a-z] will match any lowercase letter from a to z;

[a-zA-Z0-9] will match any lowercase letter, any uppercase letter, or a number;

[a-dX-Z] will match lowercase characters a, b, c, d and uppercase characters X, Y, or Z.

To match a word, enclose it in parentheses and use a pipe (|) as an “or” character. For example, to match an instance of “toyota” or “mazda”, we would type (toyota)|(mazda) or (toyota|mazda).

We use the asterisk (*) as a wildcard in a lot of things related to computers. In regex, we use a period (.) as a wildcard for a single character to match any character. For example:

car.s will match “carrs”, “car?s”, “car5s”, etc.

Repeating Patterns

With regex, we can even specify the number of times a pattern should occur.

The question mark (?) after a character will match zero or one occurrence of the character. This makes the character optional. For example:

aa?ngel will match “aangel” or “angle”.

A plus sign (+) matches one or more occurrences. For example:

e+ will match “e”, “ee”, “eeeeeeeee”, etc.

The asterisk (*) matches zero or more of the previous character. If we combine it with a period, .* it is commonly used as a wildcard because it will match any non-empty strings.

Curly brackets ({}) allow us to match a specific range of occurrences. We specify the minimum and the maximum number of occurrences. For example:

ca{3,5}r will match “caaar”, “caaaar”, “caaaaar”, but not “car” or “caaaaaaaaar”.

Google Analytics Goals: Conclusion

Goole Analytics Goals TRACK VISITOR INTERACTIONSI have defined the concepts and uses of the match types available in Google Analytics Goals so we can use them to our best interest. Google Analytics Goals allow you to track specific visitor interactions on our website. Then, once a visitor performs the particular action we have defined as a goal, Google Analytics records that as a conversion. This tracking would be instrumental in a PPC campaign, for example.

If it is one specific URL that we want to track, choose “Equals to” to match our Goal URI.

When we have created campaign URLs with UTM codes to track specific campaign performances on the page, we select “Begins with,” so no matter what comes after the URI, if someone lands on the specific web page, GA will record it as a conversion.

If you know regex, and you want to define the URL yourself or match multiple URLs with varying subdomains or UTM parameters, choose “Regular expressions.”

When it comes to matching a URL with Goal URI using match types “Equals to,” “Begins with,” and “Regular expression,” make sure to choose the one that best fits your needs. We will use each of them based on what the expected actions of visitors to our site and what steps we want to track as goals. Google Analytics Goals allow us to track specific visitor interactions on our website. Then, once a visitor performs the particular action we have defined as a goal, Google Analytics records that as a conversion.

Written by Arturo Santiago

Listen to our CEO’s podcast “The Daily Drive” to stay driven and get great business insights from top business leaders. – Are you ready to scale your agency with a quality white label SEO, white label PPC, or white label social media provider?
If so schedule a meeting here –