Salesforce B2C Commerce 20.10 > Storefront Toolkit

Test Promotions Using the Promotions Tracing Tool

The promotions tracing tool lets you test promotions before publishing them to the storefront. You can see which promotions are applicable for a particular cart. If a promotion isn’t applied to a cart, you can see the reasons why.

Because the Storefront Toolkit is available only in staging and development environments, you can’t test promotions in production environments. The tracing tool works only for evaluating the cart. It doesn’t work for Product Detail or Product List pages.
  1. Make sure the promotions that you want to test are enabled and assigned to active campaigns.
    For example, you have a promotion that discounts an order by 20 percent for a purchase of at least $200 in men’s clothing.
  2. Launch the storefront.
  3. Add products to the cart and then navigate to the cart.
    For example, add men’s clothing items to the cart.
  4. Enable promotion tracing:
    1. Click the Preview Settings Tool icon. .
    2. Select Enable Promotion Tracing and enter a Promotion Trace ID.
      The Promotion Trace ID lets you track promotion log messages in the Request Log.
    3. Click Preview.
      Log messages are saved to the Request Log. Messages indicate the promotions that were applied to the cart and those that were evaluated but not applied.
  5. To open the Request Log, click the Request Log icon.
  6. Search the Request Log for the Promotion Trace ID.
    In an environment with many promotions, the entire Request Log sometimes isn’t visible in the Request Log window. We recommend that you copy the log to a text editor and search for the Promotion Trace ID there.
    For example, if you entered TraceTest for the Promotion Test ID, search for TraceTest.
  7. To convert the results to a readable format, copy the block containing the promotion test information to any JSON parser.
    Promotions are reported as follows:
    • applicablePromotions: Promotions that a shopper is eligible for based on the context and products in the cart, for example, time, customer group assignment, or source code entry.
    • qualifiedPromotions: Promotions that a shopper is eligible for based on the qualifying products in the cart before the promotions are processed through the ranking and exclusivity algorithm.
    • appliedPromotions: Promotions applied to the cart after the promotions are processed through the ranking and exclusivity algorithm.
    For example, opening this log message in a JSON parser makes it clear that the 20 percent off order promotion wasn’t applied because the $200 threshold wasn’t met.

    If conditions are met for the promotion, the log message displayed in the JSON parser indicates that the discount was applied.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.