Rules and effects
The conditions a campaign can check and the effects it can apply.
Every campaign has at least one rule. A rule's conditions decide when it applies, and its effects decide what happens to the member, for example that they get points or a reward. A rule applies when all of its conditions are met, and a rule without conditions applies to every event of the trigger.
A campaign can have several rules, each with its own conditions and effects, for example one rule per tier with a different number of points.
Conditions
A condition compares a value with an operator, for example Transaction value Greater than 5000 or Registration date Before a date. The conditions you can pick depend on the trigger.
Member
Available for every trigger.
| Condition | Checks |
|---|---|
| Birth date, Registration date | The member's dates. |
| Email, First name, Last name, Phone, Loyalty card number, Referral token | The member's profile fields. |
| Gender, Country | The member's gender and country. |
| Anonymized | Whether the member's data has been anonymized. |
| Transaction count | How many transactions the member has. |
| Has custom attribute on member | Whether the member has a custom attribute, optionally with a specific value. |
| Tier | The member's current tier. Purchase and Return Transaction triggers only. |
| Registration place | Where the member signed up. Registration trigger only. |
Transaction
Available for the Purchase Transaction and Return Transaction triggers.
| Condition | Checks |
|---|---|
| Transaction date, Transaction value, Transaction currency | The transaction's date, gross value and currency. |
| Has product from category, Has product from brand | Whether the transaction contains a product from a category or brand. |
| Has custom attribute | A custom attribute on the transaction. |
| Has custom attribute (Product) | A custom attribute on one of the transaction's products. |
| Used reward, Used points, Used wallet | Whether the member used a reward, points or a specific wallet in this transaction. |
The Return Transaction trigger has the same checks for the original purchase, such as Original transaction date, Original transaction value and Original has product from category.
Wallets
Available for the Purchase Transaction and Return Transaction triggers.
| Condition | Checks |
|---|---|
| Active units, Pending units, Blocked units | The member's current balances. |
| Total spent units | How many units the member has spent in total. |
Custom condition
When none of the built-in conditions fits, a Custom condition lets you write your own expression. The rule applies when the expression is true. This one checks, on a Return Transaction, that the return happened within 30 days of the original purchase:
abs(date(originalTransaction.transactionDate) - date(transactionDate)) / 86400 <= 30Effects
| Effect | What it does | You choose |
|---|---|---|
| Add units | Adds units to the member's wallet. | The wallet type and the amount, as a number or a formula. Optionally a delay and an expiry date. |
| Spend units | Takes units from the member's wallet. | The wallet type and the amount. |
| Block units | Puts some of the member's units on hold. Blocked units can't be spent. | The wallet type and the amount. |
| Add block units | Holds new points for the member without adding them to any balance yet. They turn into real points only when an Activate points effect runs for the member, for example after the member completes their profile. | The wallet type, the amount and a delay. Without a delay, no points are held. |
| Activate points | Releases all points that Add block units held for the member. Points whose delay has ended become active right away, and the rest stay pending until the delay ends. It also recalculates the member's tier. | Nothing else. |
| Give reward | Gives the member a reward, for example a coupon. | The reward. |
| Cancel unit transfer | Return Transaction only. Reverses points connected to the original purchase. The return must send the original purchase's documentIdentifier in linkedTransactionId. | Pending units cancels the pending units the original purchase earned. Active units blocks the amount you enter in the chosen wallet, so the member can't spend it. |
| Trigger recalculation | Recalculates the member's tier. | Nothing else. |
| Add member custom attribute | Adds a key/value pair to the member's custom attributes. | The key and the value. |
| Update member custom attribute | Changes the value of an existing custom attribute. | The key and the new value. |
| Delete member custom attribute | Removes a custom attribute from the member. | The key. |
| Custom effect | Does what your program needs when the built-in effects don't cover it. | The Scops Loyalty team builds it with you. |
A rule can have several effects, so one rule can add points, give a reward and tag the member at the same time.
Delay and expiry
The clock icon delays an effect, for example to award points 30 days after the purchase. See Delay. On Add units, the timer icon sets Expires at, the date after which the added units expire.
Member custom attributes
The three custom attribute effects let a campaign tag members and change the tags later. Member custom attributes has an example.
Custom effects
A custom effect covers a requirement the built-in effects don't, for example calling one of your own systems or a business rule specific to you. We can build almost any behavior this way, so talk to the Scops Loyalty team about what you need.
Next steps
- Formulas calculate the amount of units from the cart.
- Create campaign puts rules together in the dashboard.