Using wildcards in segment conditions

When building out segmentation conditions, you may want to segment by a keyword present in a URL.
This article will explain 'wildcards' in your segment conditions and how to use them.

Wildcard conditions

wildcard is a symbol used to replace or represent one or more characters. 

Wildcards are typically either an asterisk (*), which represents one or more characters or question mark (?), which represents a single character. 

1. Asterisk ( * ) 

The asterisk in a wildcard matches any character zero or more times. This is great when you want to search for variable endings of a root word.

For example, "comp*" matches anything beginning with "comp" which means "comp," "complete," and "computer" are all matched.

You can use as many asterisks in a search phrase as you'd like. 

"Remember, remember the * of *." 

You can also use more than one asterisk if you'd like to have more than one wildcard in a row. Just make sure you  put a space between each asterisk.

"What a * * * is man." 

2. Question mark ( ? ) 

A question mark matches a single character once. It is most useful when there are  variable spellings for a word, and you want to search for all variants at once

For example, "c?mp" matches "camp" and "comp." 

The question mark can also be used more than once. For example, "c??p" would match both of the above examples as well as "coop." 

Example - segment traffic based on a keyword present in the URL path

If you have articles with specific keywords in the URL path, you can use the wildcard condition in your segment(s) to qualify visitors viewing these articles only.

In the example below, RightMessage will segment any traffic that is viewing URL's containing either *rainmaker* or *thesis* in the URL path.

Example - segment traffic that is referred by Google

Segmenting traffic that comes to your website via Google is not as straight forward as adding the Google domain name to the 'Domain' referral condition. 

Whilst some traffic may come from, other traffic could be referred by the various domain names that Google has, such as,,, etc.

To segment traffic that is referred by Google, use the 'Referred by URL' condition and add a wildcard match of *.google.*

Still need help? Contact Us Contact Us