You are here:
Configure Rule Libraries for Promotion Context Definitions
Global Promotions Management uses rule libraries to let marketing managers use context definition tags in promotion rule eligibility criteria. Rule libraries also enable the Eligible Promotions API to evaluate all active promotions available in the org and find the promotions and rules that are eligible for customer carts. If the admin and marketing managers decide to use different context definitions for the company's various promotions, the admin must create a rule library for each context definition.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions with Real-Time Offer Management |
| User Permissions Needed | |
|---|---|
| To create a rule library: | Context Service Admin permission set |
Depending on the requirements of a company’s various promotions, admins and marketing managers decide whether to use the standard CartDetailGetEligiblePromotion context definition or create custom context definitions. For each context definition, a Global Promotion Management rule library must be created. Marketing managers can’t activate their promotions until a Global Promotions Management type rule library is available in the org.
Rule libraries are versioned. After you create a rule library, the version of the library is automatically set to 1. You can’t create more versions of the rule library.
In the rule library version one, add custom tags mappings for all the context tags required to define promotion and promotion rule eligibility criteria, and to execute the Eligible Promotions API. The requirements of the promotions that use the rule library and the structure of the rule library's context definition decide the list of custom tag mappings required.
Here’s the list of required custom tag mappings that are required based on promotion requirements.
| Business Requirement | Custom Tag Mapping Name | Context Tag |
|---|---|---|
| The Eligible Promotion API requires the date and time when a cart is evaluated. | activityStartDate | A tag that stores the date when the customer’s cart is evaluated |
| Promotions that use the rule library have a set of eligible products. |
|
Tags that are related to the Catalog and the Product objects |
| Promotions that use the rule library have a set of eligible product categories. |
|
Tags that are related to the Catalog and the Category objects |
| Promotions that use the rule library need to uniquely identify an individual. |
|
Tags that are related to the Contact object |
| Promotions that use the rule library consist of rule eligibility criteria that check whether customers have a set of products or products from a set of categories in their cart and offer a discount on the cart. |
|
Tags that are related to cart line quantity and cart line value |
| Promotions that use the rule library consist of rule eligibility criteria that check whether customers have a set of products, or products from a set of categories, in their cart and offer discounts on specific products or products from specific categories. |
|
Tags that are related to the unique identifier of each cart line, cart line quantity, and cart line value |
| Promotions that use the rule library consist of rule eligibility criteria that check for the cart value and offer a discount on the cart. | transactionAmount | The tag that’s related to total cart value |
| Promotions that use the rule library consist of rule eligibility criteria that check for the cart value and offer discounts on specific products or products from specific categories. |
|
The tag that’s related to total cart value and the unique identifier of the cart line |
| Promotions that use the rule library consist of rules that have product selling model-based criteria condition. | productSellingModel | The tag that’s related to the Product Selling Model object |
| Promotions that use the rule library consist of rules that have product attribute-based criteria conditions. |
|
The tags that’s related to the context definition node for product attribute information |
| Promotions that use the rule library are evaluted based on an evaluation method. |
|
The tags that are related to the promotion evaluation and execution configuration |
| Promotions that are associated with the rule library must be manually selected by the customers to apply to their carts. |
|
The tags that’s related to the coupon codes |
| Promotions that use the rule library have a pricing procedure configured for promotion evaluation and execution |
|
The tag that’s related to the context definition node for cart and discount details |
|
cartLineProductCategoryList | The tag that’s related to the ID of the hierarchical product category |
-
From the App Launcher, find and select Rule Libraries.
If you can’t find Rule Libraries, add a tab for the Rule Library object from Setup.
- Click New.
- Give your rule library a name.
- Enter the API name of the new context definition.
- From Usage Type, select Global Promotions Management.
- Save your changes.
- On the Rule Library Version related list of the rule library that you created, click v1.
- On the Custom Tag Mapping related list, click New.
- Add the mapping name and select the mapping’s corresponding context tag.
- Save your changes.
- Repeat steps 8–10 for all the custom tag mappings that you require for the promotions that use the rule library.
- Activate the rule library version.
After your rule library is ready, you can share the rule library name with the marketing managers who plan to use the rule library for their promotions. If marketing managers plan to create promotion rules by using templates such as Buy X, Get Discount + Rewards and Spend X, Get Unit Price Discount on Y + Rewards, they must select the promotion’s rule library.

