Regex (or Regular Expression) is a type of code you can use when you want to match a portion of the characters in your uploaded product SKUs, categories, or promo codes with the values that are passed to impact.com with conversions. You can use regex with impact.com's Match Expression tool to identify product SKUs, categories, or promo codes for which you want to pay out differently.
By placing part of a regex inside parentheses, you can group that part of the regex together. The Match Expression tool can then extract the values you place between the brackets and find a match in the accompanying exception list items you provide. The items you add to the exception list should exactly match the regex between the parentheses so that the regex outside the parentheses can be applied to the whole list.
Your brand, ACME Smile, would like to pay out 5% to partners when a customer purchases any dental product. ACME Smile doesn't have a comprehensive list of SKUs for all dental products, because your brand is constantly removing products and adding new ones. However, you do know that all dental product SKUs start with either TOOTH, SMILE, or SHINE (e.g. SHINE98763
, SMILE987abc
, TOOTH65abc64
).
Because all dental SKUs start with TOOTH, SMILE, or SHINE, you can set up a regex for dental product SKUs in general, and use the Match Expression tool to find matches in an incomplete SKU exception list, as demonstrated in the following sections.
From the left navigation bar, select [Menu] → Settings.
Under the Exception Lists section, select SKU.
Select Add New SKU List.
Enter a List Name.
Select the event type you want to associate with this SKU list.
Select Show advanced settings and enter your regex in the Match Expression field.
Inside parentheses, add only the values for which you want to match:
Add the 3 character strings that we know dental SKUs start with, separated by the regex character
|
which means OR.
Outside the parentheses, add any regex that helps refine your match:
Add the regex character
^
before the opening parentheses to assert the position at the start of the line, ensuring that there are no preceding characters..Add the regex character
.
after the closing parentheses to match for any following characters (e.g., numerals, letters, hyphens) except for line terminators.Add the regex character
*
after the period to look for any number of matches (i.e., between 0 and unlimited matches).
The final expression should be
^(TOOTH|SMILE|SHINE).*
.
Select Save and Add items.
List the values you want to match in 1 of 2 ways:
Add Items manually by entering TOOTH, SMILE, and SHINE in the Sku fields.
Upload a CSV or Excel file listing TOOTH, SMILE, and SHINE under the SKU column.
See Create a SKU exception list for more information.
Select Save.
You'll see your new SKU list on the SKU Lists screen.
Now that you've set up a regex Match Expression and added the 3 SKU list items, all ACME Smile's future dental products (assuming they also have SKUs starting with TOOTH, SMILE, or SHINE) will be matched as part of the exception list. Any incoming conversions that match the regex will be flagged as part of the exception list and contract rules will be applied accordingly.
Now you can add rules to ACME Smile's template terms, such as paying out 5% per order whenever these SKUs are present. See Set payouts for a SKU exception list for more details.