Setting up URL patterns using Regex
Regex or Regular expression is a text string which defines a search pattern. This pattern is used by string algorithms to find, find and replace or match operations on strings. Using regular expression, you can set up a firing rule in Action Recorder for the product page, collections, category or any page that you would like to track. Below are the different cases, where we show you to set-up URL patterns using Regex.
Case 1: If your desired tracking path is at the beginning
1. For the following example, I’ve added a ( /* ) symbol after collections. Which means we will track all pages after collections, irrespective of the URL text present after it.
2. Click on save, the tracking rule saved get displayed.
Case 2: If your desired tracking path is at the center
1. Let’s try it with the different scenario where my desired path for tracking is present in between 2nd and 3rd “/” (eg: products).
2. In this scenario adding (/*/product/*) helps you to track path which is in between 2nd and 3rd “/”. Which means every URL contains products in the 2nd and 3rd “/” gets tracked irrespective of the URL text present before or after it. If products not present in between 2nd and 3rd “/”then it doesn’t get tracked.
3. Click on save, your saved pages to track get displayed on the screen.
Case 3: If your desired tracking path is a dynamic variable
1. Let’s try a different case, where I would like to track my customer ID.
2. By adding (customer/*/checkout), defines customer and the checkout as the static variable (which doesn’t change).
3. Usually, ID differs from each customer. So by adding (*) in the center represents value or the variable as a dynamic path (Differs from customer to customer) .
4. For the following example, my customer ID is 7246. By setting up a rule for firing as (customer/*/checkout). I can get the respective customer ID for each customer as the (*) represents dynamic variable.
5. Click on save, your saved pages for tracking will be displayed on the screen.
6. Click on update action, once you are done.
7. If you’re still facing facing issues, get in touch with our team by clicking on the chat icon on the lower right corner. We will set up all your events for free 🙂