Google Analytics Goals Regular Expressions vs. Equals to vs. Begins with
When you create/edit a goal in GA, you get the option to choose a match type for your goal.
Google Analytics provides three different match types:
- Equals to
- Begins with
- Regular Expression
The ‘Equals to’ goal match type
The ‘equals to’ denotes exact match.
Let us understand match types by tracking the number of orders placed on a website as a destination goal.
Follow the steps below:
Step-1: Find the URL of the ‘order confirmation’ page which is shown to a user when he makes a purchase on your website. Your developer can share the URL of the ‘order confirmation’ page.
Step-2: Copy the request URI of the ‘order confirmation’ page. The request URI is that part of the URL that comes after the domain name.
So for example, if the URL of the ‘order confirmation’ page is: https://www.optimizesmart.com/order-confirmed/
Then request URI would be: /order-confirmed/
Step-3: In your Google Analytics account navigate to the reporting view for which you want to set up the destination goal.
Step-4: Navigate to the ‘admin’ area and then click on ‘Goals’ link in the ‘view’ column:
Step-5: Click on the ‘+New Goal’ button:
Step-6: Select ‘Place an order’ goal template:
Step-7: Click on the ‘continue’ button:
Step-8: You should now see the ‘Goal Description’. You don’t need to change anything here. Just click on the ‘Continue’ button again:
Step-9: Paste the URI (and not the URL) of the order confirmation page in the text box next to ‘equals to’:
Here ‘Equals to‘ is a match type:
A match type define how Google Analytics identifies a URL (visited by a user) for a goal and/or a funnel step.
The URI provided for a goal is called the Goal URI.
For example: /order-confirmed/ is a goal URI:
The URI provided for a funnel step is called the funnel URI:
Google Analytics identify visit to the Goal URL page by matching the Goal URL with its corresponding request URI. If there is a match then it means the Goal URL page was visited.
Google Analytics identify visit to a Funnel page by matching the Funnel URL with its corresponding request URI. If there is a match then it means the Funnel page (or funnel step) was visited.
Visit to the home page
Let us suppose a user visited the home page: https://www.optimizesmart.com/
Now the request URI reported for this page (in the GA reports) would be: /
Google Analytics will match this request URI with our funnel URIs and goal URI using the ‘Equals to’ match type:
Since the request URI / does not exactly match any of the funnel URIs (/cart/ or /checkout/), GA will not record and report on any unique pageviews for the funnel steps.
Now Google Analytics will match the request URI (/) with the Goal URI (/order-confirmed/) using the ‘equal to’ match type.
Again there is no exact match. So GA will not record and report on any unique pageviews for the goal page. In other words, GA will not record and report on any order placed on the website.
If you navigate to the Funnel Visualization report (under ‘Conversions‘ > ‘Goals‘) and select ‘Place an order’ from the ‘Goal Option’ drop-down menu:
You should see no unique pageviews recorded either for funnel pages or goal pages:
Visit to the product page
Let us suppose the same user later visited the product page: https://www.optimizesmart.com/product/
Now the request URI reported for this page (in the GA reports) would be: /product/
Now Google Analytics will match this request URI (/product/) with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any unique pageviews for the funnel steps in the funnel visualization report for the goal ‘Place an order’:
Now Google Analytics will match the request URI (/product/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Again there is no exact match. So GA will not record and report on any order placed on the website:
Visit to the shopping cart page
Let us suppose the same user later visited the shopping cart page: https://www.optimizesmart.com/cart/
Now the request URI reported for this page (in the GA reports) would be: /cart/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since now there is an exact match with one of the funnel URIs, GA will record and report on one unique pageview for /cart/ funnel step in the funnel visualization report:
Since the request URI did not exactly match the funnel step /checkout/ no unique pageview for this funnel step would be recorded and reported in the Funnel visualization report.
Now Google Analytics will match the request URI (/cart/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any order placed on the website:
Visit to the checkout page
Let us suppose the same user later visited the checkout page: https://www.optimizesmart.com/checkout/
Now the request URI reported for this page (in the GA reports) would be: /checkout/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since now there is an exact match with one of the funnel URIs, GA will record and report one unique pageview for the /checkout/ funnel step in the funnel visualization report:
Now Google Analytics will match the request URI (/checkout/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any order placed on the website:
Visit to the order confirmation page
Let us suppose the same user later placed an order by visiting the order confirmation page: https://www.optimizesmart.com/order-confirmed/
The request URI reported for this page (in the GA reports) would be: /order-confirmed/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since there is no exact match with any of the funnel URIs, GA will not record and report on any new unique pageviews for the funnel steps in the funnel visualization report:
Now Google Analytics will match the request URI (/order-confirmed/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is an exact match, GA will now record and report on an order placed on the website:
‘Begins with’ and ‘Regular Expressions’ are other examples of match types:
#Begins with’ goal match type in Google Analytics
Use the ‘Begins with’ match type, if only the first part of your Goal URI and/or Funnel URI needs to match the corresponding request URIs.
Example-1
Let us suppose the following are the different URLs of the ‘order confirmation’ page:
- https://www.optimizesmart.com/order-confirmed/461245/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/order-confirmed/461246/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/order-confirmed/461247/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/order-confirmed/461248/?key=wc_order_dfgfhryrrw
So following are the corresponding request URIs:
- /order-confirmed/461245/?key=wc_order_gregfgdgg
- /order-confirmed/461246/?key=wc_order_fghertfgdyu
- /order-confirmed/461247/?key=wc_order_afretgdrtf
- /order-confirmed/461248/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type and the Goal URI is /order-confirmed/ then it won’t match any of the aforementioned request URIs:
However, if you use the ‘Begins with’ match type, then the Goal URI /order-confirmed/ would match all of the aforementioned request URIs:
Example-2
Let us suppose the following are the different URLs of the ‘checkout’ page:
- https://www.optimizesmart.com/checkout/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/checkout/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/checkout/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/checkout/?key=wc_order_dfgfhryrrw
So following are the corresponding request URIs:
- /checkout/?key=wc_order_gregfgdgg
- /checkout/?key=wc_order_fghertfgdyu
- /checkout/?key=wc_order_afretgdrtf
- /checkout/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type and the Funnel URI is /checkout/ then it won’t match any of the aforementioned request URIs:
However, if you use the ‘Begins with’ match type, then the Funnel URI /checkout/ would match all of the aforementioned request URIs:
Example-3
Let’s say following is the URL of the order confirmation page:
https://www.optimizesmart.com/order-confirmed/
Let us also suppose, the following are the different URLs of the ‘checkout’ page:
- https://www.optimizesmart.com/checkout/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/checkout/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/checkout/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/checkout/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type then the goal URI would match the corresponding request URI but the Funnel URI /checkout/ won’t match any of its corresponding request URIs:
So you should select a match type which allows both Goal URI and Funnel URIs to match with their corresponding request URIs.
The match type that you select for your goal URI also applies to all Funnel URIs. Always remember that.
The ‘Regular Expressions’ goal match type
The ‘Regular Expressions’ match type is the best match type, as it provides the most flexibility when it comes to matching Goal URI and/or Funnel URIs with their corresponding request URIs.
When you use the ‘Regular Expression’ match type, you can use regex as Goal URI and/or Funnel URIs:
Related Articles:
- How to setup destination goal in Google Analytics?
- Introduction to goal sets and ‘goal slot IDs’ in Google Analytics
- Understanding Google Analytics Goal Templates
- Google Analytics Conversion Tracking – Complete Guide
- Google Analytics Goals and Sales Funnels – Complete Guide
- How to Translate Business Objectives into Measurable Goals
- How to determine Monetary Value of Non ecommerce Conversions
- You are doing Conversion Tracking all wrong. Here is why
- Calculating True Conversion Rate in Google Analytics
- Analyzing and Reporting Conversion Rate in Google Analytics
- Is your conversion Rate Statistically Significant?
- What Matters more: Conversion Volume or Conversion Rate – Case Study
- Here is Why Conversion Volume Optimization is better than CRO
When you create/edit a goal in GA, you get the option to choose a match type for your goal.
Google Analytics provides three different match types:
- Equals to
- Begins with
- Regular Expression
The ‘Equals to’ goal match type
The ‘equals to’ denotes exact match.
Let us understand match types by tracking the number of orders placed on a website as a destination goal.
Follow the steps below:
Step-1: Find the URL of the ‘order confirmation’ page which is shown to a user when he makes a purchase on your website. Your developer can share the URL of the ‘order confirmation’ page.
Step-2: Copy the request URI of the ‘order confirmation’ page. The request URI is that part of the URL that comes after the domain name.
So for example, if the URL of the ‘order confirmation’ page is: https://www.optimizesmart.com/order-confirmed/
Then request URI would be: /order-confirmed/
Step-3: In your Google Analytics account navigate to the reporting view for which you want to set up the destination goal.
Step-4: Navigate to the ‘admin’ area and then click on ‘Goals’ link in the ‘view’ column:
Step-5: Click on the ‘+New Goal’ button:
Step-6: Select ‘Place an order’ goal template:
Step-7: Click on the ‘continue’ button:
Step-8: You should now see the ‘Goal Description’. You don’t need to change anything here. Just click on the ‘Continue’ button again:
Step-9: Paste the URI (and not the URL) of the order confirmation page in the text box next to ‘equals to’:
Here ‘Equals to‘ is a match type:
A match type define how Google Analytics identifies a URL (visited by a user) for a goal and/or a funnel step.
The URI provided for a goal is called the Goal URI.
For example: /order-confirmed/ is a goal URI:
The URI provided for a funnel step is called the funnel URI:
Google Analytics identify visit to the Goal URL page by matching the Goal URL with its corresponding request URI. If there is a match then it means the Goal URL page was visited.
Google Analytics identify visit to a Funnel page by matching the Funnel URL with its corresponding request URI. If there is a match then it means the Funnel page (or funnel step) was visited.
Visit to the home page
Let us suppose a user visited the home page: https://www.optimizesmart.com/
Now the request URI reported for this page (in the GA reports) would be: /
Google Analytics will match this request URI with our funnel URIs and goal URI using the ‘Equals to’ match type:
Since the request URI / does not exactly match any of the funnel URIs (/cart/ or /checkout/), GA will not record and report on any unique pageviews for the funnel steps.
Now Google Analytics will match the request URI (/) with the Goal URI (/order-confirmed/) using the ‘equal to’ match type.
Again there is no exact match. So GA will not record and report on any unique pageviews for the goal page. In other words, GA will not record and report on any order placed on the website.
If you navigate to the Funnel Visualization report (under ‘Conversions‘ > ‘Goals‘) and select ‘Place an order’ from the ‘Goal Option’ drop-down menu:
You should see no unique pageviews recorded either for funnel pages or goal pages:
Visit to the product page
Let us suppose the same user later visited the product page: https://www.optimizesmart.com/product/
Now the request URI reported for this page (in the GA reports) would be: /product/
Now Google Analytics will match this request URI (/product/) with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any unique pageviews for the funnel steps in the funnel visualization report for the goal ‘Place an order’:
Now Google Analytics will match the request URI (/product/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Again there is no exact match. So GA will not record and report on any order placed on the website:
Visit to the shopping cart page
Let us suppose the same user later visited the shopping cart page: https://www.optimizesmart.com/cart/
Now the request URI reported for this page (in the GA reports) would be: /cart/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since now there is an exact match with one of the funnel URIs, GA will record and report on one unique pageview for /cart/ funnel step in the funnel visualization report:
Since the request URI did not exactly match the funnel step /checkout/ no unique pageview for this funnel step would be recorded and reported in the Funnel visualization report.
Now Google Analytics will match the request URI (/cart/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any order placed on the website:
Visit to the checkout page
Let us suppose the same user later visited the checkout page: https://www.optimizesmart.com/checkout/
Now the request URI reported for this page (in the GA reports) would be: /checkout/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since now there is an exact match with one of the funnel URIs, GA will record and report one unique pageview for the /checkout/ funnel step in the funnel visualization report:
Now Google Analytics will match the request URI (/checkout/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is no exact match, GA will not record and report on any order placed on the website:
Visit to the order confirmation page
Let us suppose the same user later placed an order by visiting the order confirmation page: https://www.optimizesmart.com/order-confirmed/
The request URI reported for this page (in the GA reports) would be: /order-confirmed/
Now Google Analytics will match this request URI with one of the funnel URIs (/cart/ or /checkout/) using the ‘Equals to’ match type.
Since there is no exact match with any of the funnel URIs, GA will not record and report on any new unique pageviews for the funnel steps in the funnel visualization report:
Now Google Analytics will match the request URI (/order-confirmed/) with the Goal URI (/order-confirmed/) using the ‘Equals to’ match type.
Since there is an exact match, GA will now record and report on an order placed on the website:
‘Begins with’ and ‘Regular Expressions’ are other examples of match types:
#Begins with’ goal match type in Google Analytics
Use the ‘Begins with’ match type, if only the first part of your Goal URI and/or Funnel URI needs to match the corresponding request URIs.
Example-1
Let us suppose the following are the different URLs of the ‘order confirmation’ page:
- https://www.optimizesmart.com/order-confirmed/461245/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/order-confirmed/461246/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/order-confirmed/461247/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/order-confirmed/461248/?key=wc_order_dfgfhryrrw
So following are the corresponding request URIs:
- /order-confirmed/461245/?key=wc_order_gregfgdgg
- /order-confirmed/461246/?key=wc_order_fghertfgdyu
- /order-confirmed/461247/?key=wc_order_afretgdrtf
- /order-confirmed/461248/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type and the Goal URI is /order-confirmed/ then it won’t match any of the aforementioned request URIs:
However, if you use the ‘Begins with’ match type, then the Goal URI /order-confirmed/ would match all of the aforementioned request URIs:
Example-2
Let us suppose the following are the different URLs of the ‘checkout’ page:
- https://www.optimizesmart.com/checkout/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/checkout/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/checkout/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/checkout/?key=wc_order_dfgfhryrrw
So following are the corresponding request URIs:
- /checkout/?key=wc_order_gregfgdgg
- /checkout/?key=wc_order_fghertfgdyu
- /checkout/?key=wc_order_afretgdrtf
- /checkout/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type and the Funnel URI is /checkout/ then it won’t match any of the aforementioned request URIs:
However, if you use the ‘Begins with’ match type, then the Funnel URI /checkout/ would match all of the aforementioned request URIs:
Example-3
Let’s say following is the URL of the order confirmation page:
https://www.optimizesmart.com/order-confirmed/
Let us also suppose, the following are the different URLs of the ‘checkout’ page:
- https://www.optimizesmart.com/checkout/?key=wc_order_gregfgdgg
- https://www.optimizesmart.com/checkout/?key=wc_order_fghertfgdyu
- https://www.optimizesmart.com/checkout/?key=wc_order_afretgdrtf
- https://www.optimizesmart.com/checkout/?key=wc_order_dfgfhryrrw
Now here if you use the ‘equals to’ match type then the goal URI would match the corresponding request URI but the Funnel URI /checkout/ won’t match any of its corresponding request URIs:
So you should select a match type which allows both Goal URI and Funnel URIs to match with their corresponding request URIs.
The match type that you select for your goal URI also applies to all Funnel URIs. Always remember that.
The ‘Regular Expressions’ goal match type
The ‘Regular Expressions’ match type is the best match type, as it provides the most flexibility when it comes to matching Goal URI and/or Funnel URIs with their corresponding request URIs.
When you use the ‘Regular Expression’ match type, you can use regex as Goal URI and/or Funnel URIs:
Related Articles:
- How to setup destination goal in Google Analytics?
- Introduction to goal sets and ‘goal slot IDs’ in Google Analytics
- Understanding Google Analytics Goal Templates
- Google Analytics Conversion Tracking – Complete Guide
- Google Analytics Goals and Sales Funnels – Complete Guide
- How to Translate Business Objectives into Measurable Goals
- How to determine Monetary Value of Non ecommerce Conversions
- You are doing Conversion Tracking all wrong. Here is why
- Calculating True Conversion Rate in Google Analytics
- Analyzing and Reporting Conversion Rate in Google Analytics
- Is your conversion Rate Statistically Significant?
- What Matters more: Conversion Volume or Conversion Rate – Case Study
- Here is Why Conversion Volume Optimization is better than CRO
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.