Classification sets rules
You use rules to support automatic classifications in scenarios where your key dimension is constantly changing. The update of classifications through upload or automation becomes a cumbersome process or lags proper classification for new dimension values. For example, internal campaigns, tracking codes, or product SKUs.
The dimension must contain values that allow you to apply one or more rules so you can derive classification data from the dimension values.
You define rules within the context of a classification set. This context implies that rules are applied (when activated) to all report suite and key dimension combinations that are subscribed to the classification set. This implementation is different from how the legacy Classification rule builder works. In the Classification rule builder, you define one or more rules as part of a rule set separately, and then associate the rule set with one or more report suites. In the new interface, the rules within the classification set are also referred to as rule set. However, the rule sets are defined within the same interface where you configure other classification set attributes.
To define a rule set for a classification set:
-
Select Components from the Adobe Analytics top menu bar, then select Classification sets.
-
In Classification Sets, select the Classification Sets tab.
-
In the Classifications Sets manager, select the classification set for which you want to define the rules.
-
In the Classification Set: classification set name dialog, select the Rules tab.
-
If you are accessing the Rules interface for the first time for a classification set, or decided so far to continue to use the legacy rules builder interface, you are presented with a dialog that allows you to select how to get started. The options are:
-
Migrate existing rules. Import your current classification rules and continue to work with these rules in the new interface. Your existing rules are preserved and converted to the new format.
-
Select Migrate rules to continue.
-
In the Confirm migration dialog, read the implications of the migration.
- Select Migrate rules to confirm the migration. After the migration is completed, use the Rule set interface to create new rules and edit your existing migrated rules.
- Select Cancel to cancel the migration
-
-
Start fresh. Create new classification rules from scratch using the new rule builder. Select this option if you want to redesign your classification logic or start fresh with new classification rules.
-
Select Create new rules to continue.
-
In the Confirm start fresh dialog, read the implications of a fresh start.
- Select Start fresh to confirm a fresh start and discard any existing rules. Use the Rule set interface to create new rules.
- Select Cancel to cancel.
-
-
Use legacy interface. Continue to use the previous rule builder interface. You can migrate to the new experience at any time when you’re ready.
- Select Go to legacy interface to continue. You are directed to the legacy Classification Rule Builder interface.
-
-
If you already have migrated rules or created new rules for a classification set, you end up directly in the Rule set interface.
-
Rule set interface rule-set-interface
To create or edit rules, use the Rule set interface.
See the Rule interface for more information.
You can insert functions at any place, and the functions are executed in sequence to determine the final values for the classifications.
Use Collapse all to collapse all rules and use Expand all to expand all rules.
Select Activate to activate the rule set.
Select Deactivate to deactivate the rule set.
Select an option (from 1 month to 6 months) from the drop-down menu.
Select Perform lookback to perform a lookback using the selected lookback period.
Use sample key dimension values to test the classifications:
- Add or paste values in the Sample keys text area.
Check Remember sample keys to ensure that sample keys persist across different usage of the rule set interface. - Select Test rule set to test your rule set.
Rule interface
You define each individual rule within the rule set in the Rule interface. The interface consists of the following elements:
^(.+)\:(.+)\:(.+)$ for a regular expression that identifies three classifications in an internal campaign code.Select a classification from the Set Classification drop-down menu and enter a value for to.
Use
Select
Function reference
For each supported function, find details below on required input and sample use cases.
Starts With…
Sets a classification based on a specific value that the key dimension starts with.
Required input
Enter a value for Starts With. For example: em.
Use case
You want to define a rule to assign Email as the value for the Channel classification when the value for key dimension Internal Campaign starts with em (for example: em:FY2025:Summer Sale).
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Ends With…
Sets a classification based on a specific value that the key dimension ends with.
Required input
Enter a value for Ends With. For example: 2025.
Use case
You want to define a rule to assign 2025 as the value to the Year classification when the value for key dimension Internal Campaign contains 2025 (for example: em:Summer Sale:FY2025).
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Contains…
Sets a classification based on a specific value that the key dimension contains.
Required input
Enter a value for Contains. For example: Winter.
Use case
You want to define a rule to assign Winter Sale as a value to the Type classification when the value for key dimension Internal Campaign contains with Winter (for example: fb:Winter:FY2024).
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Matches
Sets a classification based on a specific value that matches with the key dimension value.
Required input
Enter a value for Matches. For example: em:Summer:2025.
Use case
You want to define a rule to assign Email as a value to the Channel classification, Summer Sale as a value to the Type classification, and 2025 to the Year classification. But only when the value for key dimension Internal Campaign matches em:Summer:2025.
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Regular expression
Sets one or more classifications based on a regular expression applied to the key dimension value.
Required input
Enter a value for Regular Expression. For example: ^(.+)\:(.+)\:FY(.+)$.
Use case
You want to define a rule to assign values to the Channel, Type, and Year classifications by applying the regular expression ^(.+)\:(.+)\:FY(.+)$ and using match groups ($1, $2, and $3) to the values for the key dimension Internal Campaign.
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Reference Table
See below for a reference table of regular expressions.
| table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 6-row-2 7-row-2 8-row-2 9-row-2 10-row-2 11-row-2 12-row-2 13-row-2 14-row-2 15-row-2 16-row-2 17-row-2 18-row-2 19-row-2 20-row-2 21-row-2 22-row-2 23-row-2 24-row-2 25-row-2 26-row-2 | |
|---|---|
| Regular expression | Description |
(?ms) |
Match the entire regular expression against a multi-line input, allowing the . wildcard to match any newline characters |
(?i) |
Match the entire regular expression to be case insensitive |
[abc] |
A single character of: a, b or c |
[^abc] |
Any single character except: a, b, or c |
[a-z] |
Any single character in the range a-z |
[a-zA-Z] |
Any single character in the range a-z or A-Z |
^ |
Start of line (matches the beginning of the line) |
$ |
Match the end of the line (or before the newline at the end) |
\A |
Start of string |
\z |
End of string |
. |
Match any character (except a new line) |
\s |
Any whitespace character |
\S |
Any non-whitespace character |
\d |
Any digit |
\D |
Any non-digit |
\w |
Any word character (letter, number, underscore) |
\W |
Any non-word character |
\b |
Any word boundary |
(...) |
Capture everything enclosed |
(a\b) |
a or b |
a? |
Zero or one of a |
a* |
Zero or more of a |
a+ |
One or more of a |
a{3} |
Exactly 3 of a |
a{3,} |
3 or more of a |
a{3,6} |
Between 3 and 6 of a |
Split
Splits the key dimension value, based on a token, to one or more classifications.
Required input
Enter a value for Split. For example: :.
Use case
You want to define a rule that splits the values for key dimension Internal Campaign to the Channel, Type, and Year classifications based on the : Token.
| tabs | |
|---|---|
| Rule |
|
| Test results |
|
Rule priority
The last rule determines the value for the classification if:
- A key dimension value is matched to multiple rules.
- The rules set contain rules with the same Set Classification operation.
So, you should rank the most important Set Classification operation as part of the last rule in your rule set.
If you create multiple rules that do not share the same Set Classification operation, processing order does not matter.
Example
You want to classify with the classification Type how users search for an athlete using the search string as the key dimension. For example, using this rule set:
- When a user searches for
Cowboys Fantasy Tony Romo,Romois classified as Type. - When a user searches for
Cowboys Fantasy Tony Romeo,Fantasyis classified as Type. - When a user searches for
Cowboys vs. Broncos,Teamis classified as Type.