With Mouseflow, you can target pages using regular expression. Regular expressions or "regex" for short, are patterns that can be used to match characters, strings, parameters, and many other combinations. Regex gives you the ability to define page rules for paths that may contain unique parameters.

In Mouseflow, you can use regex in your website settings, both in the Recording Controls and in the Advanced Settings (you can also use regex to define page rules in a Feedback Campaign).

Using Regex in Mouseflow to Target Pages.

Using the links provided below, let's say you want to target pages that contain the path titled "product".

www.mouseflow.com/1234/products/ABC

www.mouseflow.com/4321/products/XYZ

To do this, you start by adding .* and then you can enter the keyword you want to match on.

The regex with the operators included should appear like so:

.*products.*

Note: This can be used on URLs that contain paths or parameters that change, as long as the path is enclosed in two forward slashes, for example:

www.mouseflow.com/1234/products/ABC

www.mouseflow.com/4321/products/XYZ

Now let's say you want to include two URL paths or "subfolders" (please see link examples below).

www.mouseflow.com/1234/products/software/ABC

Using the links above, if you want to target "/products/software/", you can do so by adding the operators like so:

.*products\/software.*

Using Regex to Exclude Pages in Mouseflow.

With regex, you have the ability to exclude certain paths. Using the following links, let's say you want to exclude pages that include the path "/pricing".

www.mouseflow.com/1234/pricing/enterprise/ABC

You can do this by adding the following operators:

^((?!pricing).)*$

Note: It's very important that you DO NOT add multiple instances of the exclusion regex (^((?!\/pricing\/).)*$) described above! if you need to exclude multiple Paths using regex please follow the guide below.

Using Regex to Exclude Multiple Pages in Mouseflow.

If you want to exclude multiple URLS from being recorded, you can use Regex. For example, if you wanted to exclude both pages that include the path "/product" and "/pricing".

www.mouseflow.com/1234/products/software/ABC

www.mouseflow.com/1234/categories/applications/ABC

www.mouseflow.com/1234/pricing/enterprise/ABC

you would need to add the below as a single entry like this

1^((?!product|pricing).)*$
Did this answer your question?