Earn Rules specify how Members earn metrics (such as reward points) for different Activity types. Earn Rules are typically used by clients who have an "earn and burn" style program, in which Members makes purchases in order to earn points. Members can then spend those points on Rewards, or to make other purchases.
An Earn Rule comprises the following elements:
Activity Type: An action that a Member must take, such as a purchase.
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 is true.
Calculation: The earned metric value from this Rule; note that this value may combine with the result of other Earn Rules for determining the final result.
Status: The life cycle status of the Earn Rule, including its effectivity period.
Calculations and Conditions can be written as Groovy expressions. You can use Calculation Functions to encapsulate common scenarios and to simplify the process of authoring Earn Rules. Further, custom encapsulation of Calculation or Condition scenarios can be written as Member Functions. Many rule calculations may be accomplished as a lookup from a spreadsheet of key/value pairs.
Below are several examples of common Earn Rules.
Description: For every point-of-sale Purchase, earn 1 Reward Point for each $1 spent.
Activity Type: PoS Purchase
Metric: Reward Points
Condition: Empty
Calculation:
getActivityValue('amount')
Description: Give a 15 Reward Point bonus for purchases more than $200.
Activity Types: PoS Purchase
Metric: Reward Points
Condition:
getActivityValue('amount') >= 200
Calculation: 15
Description: Give different Reward Points for 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 is stored in the column "point_factor." The value in "point_factor" in the Lookup table needs to be multiplied by the amount spent on the item.
Activity Types: PoS Purchase
Metric: Reward Points
Condition: Empty
Calculation:
sumActivityItems({item -> getLookupValue ('point_lookup', item.category, 'point_factor') * item.amount})
The platform allows you to assign Earn Rules to a Rule Group. Rule Groups serve as an organizational function, and also as tool to implement common loyalty scenarios. For more details on setting up Rule Groups, please see Earn Rule Settings.
To access the Earn Rules screen, select Rules from the Main Navigation Menu, then select Earn Rules from the Sub-Category menu.
The Earn Rules screen provides the following features:
Searching and Sorting SearchThe search feature allows you to search for a specified text string anywhere within the Earn Rule's Display Name or Internal Name.
Expand / CollapseWithin the Earn Rules screen, all of the Earn Rules are displayed beneath a sub-heading that indicates the Earn Rule Group. Optionally, you can expand / collapse a Earn Rule Group by clicking the minus-sign or plus-sign icon next to the Earn Rule name.
|
Create a New Earn Rule To create a new Earn Rule:
Define the ConditionWhen the Member performs the Activity specified for an Earn Rule, the platform checks the Condition, which is represented as a logical expression. The Earn Rule is invoked only if this Condition is satisfied. Note: The use of Conditions is optional. If the Condition is not defined, the Earn Rule will apply to every individual who performs the assigned Activity Type. To define the Earn Rule Condition
Note: Instead of defining a Rule through the user interface, you can provide code to perform more complex query logic. Enter your custom code in the Advanced Expression field.
When defining the Rules for the Condition, you can optionally organize the Rules into a Group to create more sophisticated logical statements.
Define the CalculationThe Calculation specifies the mathematical formula for the point metric. If the Condition is met, the platform calculates the appropriate adjustment to the Member's earned point value. Note: Defining the Calculation requires knowledge of the Groovy programming language.
Note: This Help topic doesn't cover the Template authoring mode.
|
Set Status and Effectivity Period To edit the status and Effectivity Period for an Earn Rule:
Define a New Recurring ScheduleTo define a new recurring schedule for an Earn Rule's effectivity:
|
Deploy Earn Rules Metadata After you've created an Earn Rule, you must deploy the Earn Rule metadata. When you deploy the Earn Rules metadata to the server, the process automatically deploys the metadata for ALL modified Earn Rules.
Note: You can deploy metadata immediately, but the best practice is to validate the Earn Rules logic before deploying metadata to ensure no incorrect expression code gets deployed to the server that could cause issues.
|
View Deployed Earn Rules Metadata To see the details of what Earn Rules metadata has been deployed:
|
Rearrange Earn Rules The sequence in which the Earn Rules appear within an Earn Rule Group controls the sequence in which the platform executes the Earn Rules in that Group. For example, if you have five Earn Rules within a Group, and that Group is configured to use the "Execute only first applicable rule" strategy, the platform will interrogate the first Earn Rule in the Group. If that condition fails, the platform will move on to the second Earn Rule, and so forth. To rearrange the Earn Rules:
Note: You can't drag-and-drop an Earn Rule into a different Earn Rule Group. To change an Earn Rule's inclusion in a Group, you must edit its properties (see below for more details on this process).
|
Edit Earn Rule Properties To edit the properties of an Earn Rule:
|
Delete an Earn Rule To delete an Earn Rule:
|
Copy an Earn Rule The Loyalty platform allows you to copy an Earn Rule to use as the basis for a new Earn Rule. To copy an Earn Rule:
|
Evaluate Expression |
Download JSON To download the underlying JSON code for all Earn Rules:
|
Last Updated: October 2024