Rules can be a useful tool alongside machine learning. Your company may have unique business policies that you’d like to implement within Ravelin. For example, you may want to:
- Prevent all orders greater than $100 made from a customer who opened an account within the past 30 days
- Allow all orders from customers who are tagged as 'VIP'
Rules allow you to implement this business logic as specific actions to be taken whenever an order matches the conditions that you define.
For each rule, you'll need to select the action (Allow, Prevent, Review) triggered by the rule and define the conditions under which the rule is triggered.
A rule can contain up to eight conditions. A condition is made up of three parts:
- Attribute - The attribute of the order (e.g. the order value or the customer account age)
- Operator - The arithmetic that compares the criteria to the value (e.g. less than or equal to)
- Value - The value you wish to use (e.g. 100.00 GBP)
Creating Rules on the Dashboard
Only people who have Admin or Developer access are able to create rules.
You can create and manage rules in the Rules section of the dashboard. The Rules section can be found via this icon on the left menu:
To add a rule, click the blue Create rule button towards the top right of the Rules page.
Click Add condition and select the conditions that you want your rule to have. This includes choosing the attribute, operator and value for the condition. You can filter by types of conditions (for example all conditions to do with an Order or Customer) or you can search by condition name. Each condition has a description of what it is and an example.
Once you are happy with the conditions of the rule, you can set the action you want the rule to result in. You can set this to Allow, Review or Prevent.
In order to publish the rule, you first have to test the rule by selecting the ‘Estimate Rule Impact’ button. This will give you an indication of whether the criteria used are too strict or not strict enough.
The Estimate Rule Impact breakdown will show you an estimate of what percentage of active customers in the last 7 days would be impacted by the rule. A visual summary of the last action, score distribution and manual reviews associated with the test sample is also shown.
If the rule test results are over 5%, you will not be able to create the rule. Please contact us if you are unable to create a rule - Ravelin can do further analysis on the rule impact and discuss options for implementation.
Please note, the Estimate Rule Impact is based on a sample and is used to give an indication of the effect on customers and orders.
Creating Test Rules
Test Rules allow you to evaluate a rule without it impacting any customers. Test Rules will NOT result in an action being taken on a customer. For example, if you create a Test Rule and set the action to Prevent and a customer meets the criteria specified, you will be able to see that the customer would have been impacted by that rule but we won’t return that result when you score the customer.
Only people who have Admin or Developer access are able to create Test Rules.
You will need to select the Estimate Rule Impact button, but you can add a Test Rule regardless of what the result is (unlike Live Rules).
To add a Test Rule, select Run in Test Mode when creating a rule - this can be found under the Publish Rule step.
Evaluating Test Rules
You can review which customers would have been affected by a Test Rule in Explore. Under the Customers and Orders list you can use the Test Rules filter to see which customers and orders would have been impacted by the rule if it were live.
Please note, the filter will not show you customers or orders who matched the criteria only. The filter will display customers and orders who matched the criteria AND where the rule would have been responsible for the last action.
You can also review Test Rule performance in Analytics by using the Test Rules segment.
If your Test Rule does not impact many customers taking into account other sources e.g. if on its own it does not have a significant impact then it may be worth reconsidering whether you want to promote that rule to Live Mode or not.
You can change a rule mode at any time by updating the rule. To do this, edit the Test Rule and change the selection to Run in Live Mode. To change the mode, you will need to run the Estimate Rule Impact again.
Managing Rules on the Dashboard
The Rules list page shows you the Live and Test Rules that are in place. You can search for specific rules by name using the search bar at the top left of the rules list page. Alternatively, you can also filter by Ravelin Action and who created the rule by using the dropdown filters on the right of the rules list page.
To edit or delete a rule, select the menu option towards the right of each rule.
Each order will be evaluated against the rules you have created and processed in a specific order. In most cases, rules are processed in the following order unless you have specifically asked for the processing order to be altered for an individual rule:
If a payment matches a rule's conditions, the rule's action is performed and no other rules are processed. For example, if an Allow rule is triggered, no Prevent or Review rules will be processed. Allow rules should rarely be implemented as they override other rules in place.
Within the greater Ravelin system, manual reviews will always take precedence over rules. In addition, rules will always take precedence over Ravelin fraud scores.