Understanding campaign evaluation
Understanding how Talon.One executes one or more campaigns is important to help you build advanced promotion use cases.
Evaluating campaigns with promotion rules
The general evaluation order of campaigns with promotion rules is:
- Information is fetched from Catalogs.
- Campaigns are evaluated one by one
according to their evaluation tree.
- Inside each campaign, cart item filters are evaluated in their order of appearance in the Campaign Manager.
- The rules are evaluated in their order of appearance in the Campaign Manager.
- Inside each rule, each condition and effect is also checked and applied in order of appearance.
- The effects are returned via the Integration API.
Evaluating campaigns with strikethrough rules
The general evaluation order of campaigns with strikethrough rules is:
- Talon.One monitors a specific set of events happening in cart item catalogs, or in campaigns containing strikethrough rules.
- When such an event is triggered, Talon.One evaluates all active campaigns with strikethrough rules according to their evaluation tree.
- Talon.One sends a request to the URLs set in your strikethrough pricing notifications.
To learn more about the strikethrough pricing feature, see strikethrough rules and strikethrough pricing notifications.
Evaluating stores-based campaigns
Stores-based campaign evaluation is applicable only if your Application has stores. You can create stores in your Application with the Create store endpoint.
There are two types of stores-based campaign evaluation:
- All stores: Your campaign is evaluated for all the stores that are present in the Application.
- Specific stores: Your campaign is evaluated only for selected stores. Each store is linked to the campaign.
Evaluating all stores-based campaigns
The general evaluation order of all stores-based campaigns is:
- Talon.One receives a customer session with or without store integration ID(s).
- Talon.One checks the type of stores-based evaluation for the campaigns within the Application.
- Talon.One evaluates all the all stores-based campaigns in the Application along with the campaigns linked to the store integration ID(s) passed in the customer session, according to their evaluation tree.
Imagine you want to run a campaign offering a discount to customers irrespective of their stores.
When Talon.One receives a customer session containing the store integration ID Store_001, it evaluates all the campaigns with all stores-based evaluation.
Evaluating specific stores-based campaigns
The general evaluation order of specfic stores-based campaigns is:
- Talon.One receives a customer session with store integration ID(s).
- Talon.One checks the type of stores-based evaluation for the campaigns within the Application.
- From all the specific stores-based campaigns, Talon.One only evaluates those linked to the store integration ID(s) passed in the customer session, according to their evaluation tree.
Imagine you want to run a campaign to offer a discount to customers of particular stores. These stores have store integration IDs Store_001, Store_007, and Store_010.
When Talon.One receives a customer session containing the store integration ID Store_001, it only evaluates the campaigns linked to the particular store integration ID.
Evaluating cart item filters
To increase performance, the Rule Engine evaluates cart item filters only in the following cases:
-
A condition referencing a cart item filter is about to be evaluated or a valid effect referencing a cart item filter is going to be applied.
In this case, only the cart item filter referenced by the condition or effect is evaluated.
-
A discount effect or an update effect is about to be evaluated.
In this case, the Rule Engine evaluates from top to bottom all cart item filters that haven't yet been evaluated.
Evaluating rules
The campaign rules are evaluated by the Rule Engine from top to bottom as they appear in the Rule Builder section.
Before evaluating the campaign rules, the Rule Engine collects any customer profile data using the profile's integration ID, as that data may be required to evaluate the rules.
All conditions of a rule are evaluated and all its effects are applied before evaluating the next rule. If a condition is not met, the rule fails, and the next rule is evaluated.
If all the rules of a campaign fail, the next campaign in the campaign evaluation tree is evaluated.
Evaluating conditions
The conditions of each rule are evaluated by the Rule Engine from top to bottom as they appear in the rule.
All the conditions of the same rule are evaluated before the rule effects are evaluated.
If a failure effect was added to a condition or to a group of conditions, the effect is applied as soon as the condition fails.
Evaluating effects
The Rule Engine evaluates whether the effects of each rule can be applied. It does it based on the order in which the effects appear in the rule, from top to bottom.
Each valid effect is added to the array of effects of the customer session response as the Rule Engines evaluates if it can be applied, so the Rule Engine takes the effect into account when evaluating if the following effects can be applied. If one effect cannot be applied, all the other effects in the same rule will also not be applied.
Any existing campaign budgets are checked when evaluating if the effects that impact them can be applied.
Example
For this example, consider a campaign with 3 cart item filters and 2 rules. The first rule has 2 conditions and 1 effect, and the second rule has 1 condition and 2 effects.
Cart item filters | Rule 1 | Rule 2 |
---|---|---|
Filter 1 Filter 2 Filter 3 | Condition 1 Condition 2 Effect 1 | Condition 1 Effect 1 Effect 2 |
Also consider the following:
- Filter 2 is referenced by Condition 2 in Rule 1.
- Filter 3 is referenced by Effect 2 in Rule 2.
- Effect 1 in Rule 2 is a discount effect. The other effects are coupon effects.
The Rule Engine evaluates the cart item filters and conditions, and applies the effects, in the following order:
-
Rule 1
- Condition 1
- Filter 2
- Condition 2
noteFilter 2 is evaluated when the condition that references it is about to be evaluated.
- Effect 1
-
Rule 2
- Condition 1
- Filter 1
- Filter 3
- Effect 1
noteFilter 1 and Filter 3 are evaluated when the Rule engine is about to evaluate if the discount effect can be applied.
- Effect 2