Getting Started with Earn Rules

Overview

An Earn Rule is a type of Rule within the Loyalty platform that specifies Metric adjustments for Members performing different Activity Types. A common use case for Earn Rules is an "earn and burn" style loyalty program, in which Members make purchases to earn Metrics. Members can then spend those Metrics on Rewards or make other purchases.  

An Earn Rule comprises the following elements:

  • Activity Type: An action that a Member must take, such as making a purchase or enrolling in your loyalty program, for example.

  • Metric: The Metric whose value is calculated by this Earn Rule.

  • Condition: If a Condition is specified, the Earn Rule is applied only if the Condition evaluates to true. The use of a Condition in an Earn Rule is optional. If you don't define a Condition, the Earn Rule is assumed to always apply, whenever a Member performs the specified Activity Type. Conditions can be written using the platform's standard condition-builder interface.

  • Calculation: The Metric adjustment resulting from the Member performing the specified Activity Type. This Metric adjustment may combine with the result of other Earn Rules for determining the final result (see Getting Started with Earn Rule Groups for details on combining multiple Earn Rules). Calculations must be written as Groovy expressions. You can use Calculation Functions or Member Functions to encapsulate common scenarios and to simplify the process of authoring Earn Rules. In addition, Earn Rule calculations may be accomplished as a Lookup from a table of key / value pairs.

  • Status: The life cycle status of the Earn Rule, including its effectivity period.

Earn Rules and Order Rules

Earn Rules can optionally be used in conjunction with Order Rules. Order Rules are designed to calculate the Metrics that a Member accrues upon making a purchase. Order Rules provide a simpler interface for defining this calculation, and don't require the use of Groovy expressions like Earn Rules do. However, Order Rules are limited to responding to only Orders, whereas Earn Rules can be used to calculate Metric adjustments for any Activity Type.

If using an Order Rule, when a Member completes an Order, the Order Rule receives the Order details, calculates the Metrics that the Order is worth, then creates a Purchase Activity on the Member’s Profile. The Order Rule populates an Attribute on the Purchase Activity named sl_value with the Metrics to be accrued. An Earn Rule then triggers from the Purchase Activity, looks at the sl_value, and assigns the Metrics to the Member’s Profile.

Note: If you define and publish an Order Rule, you do not also need to define an associated Earn Rule. The platform utilizes a standard, default Earn Rule named “Purchase (system)” that will trigger when the Order Rule creates the Purchase Activity on the Member Profile. This default Earn Rule performs the necessary adjustments to the Member’s Metric balance, based on the results of the Order Rule.

For more information on Order Rules, see Getting Started with Order Rules.

Examples

Below are several examples of common Earn Rule scenarios. These examples all reference a Metric named "Reward Points."

Description: For every Point of Sale (POS) Purchase, the Member earns 1 Reward Point for each $1 spent.

  • Activity Type: POS Purchase

  • Metric: Reward Points

  • Condition: None

  • Calculation: getActivityValue('amount')

Description: Grant a bonus of fifteen Reward Points for purchases over $200.

  • Activity Types: POS Purchase

  • Metric: Reward Points

  • Condition: getActivityValue('amount') >= 200

  • Calculation: 15

Description: Give different Reward Points for different types of items purchased. The Lookup table "point_lookup" defines how many Points to give for every dollar spent for items in different categories. The result in the Lookup table is stored in the column "point_factor." The value in "point_factor" in the Lookup table is then multiplied by the amount spent on the item to arrive at the final Metric adjustment.

  • Activity Types: POS Purchase

  • Metric: Reward Points

  • Condition: None

  • Calculation: sumActivityItems({item -> getLookupValue ('point_lookup', item.category, 'point_factor') * item.amount})

Earn Rule Groups

The platform allows you to assign Earn Rules to an Earn Rule Group. Earn Rule Groups serve as an organizational function, and also as a way to implement common loyalty program scenarios, such as combining multiple applicable Earn Rules. For more details, see Getting Started with Earn Rule Groups.

Access

The Earn Rules screen is used to view, create, and manage the Earn Rules in your loyalty program. To access the Earn Rules screen, select Rules from the top navigation menu, then select Earn Rules from the side navigation menu.

For more details on how to search for an Earn Rule, see Search for an Earn Rule.

Create an Earn Rule Configure Earn Rule Condition Configure Earn Rule Calculation