Source Codes as Promotion Qualifiers for B2C Commerce

A shopper-supplied source code can qualify promotions at runtime. When a shopper provides a valid code, B2C Commerce activates the associated price books, redirects, and promotions, then processes the source code from URLs, cookies, and shopper submissions.

As a promotion qualifier, a source code is a value that a shopper supplies to unlock specific offers. The shopper provides it through a redirect link on an affiliate website, by entering a value from a print catalog, or by submitting a code on the site. When the code is valid, B2C Commerce activates the promotions, price books, and redirects tied to it for that session.

Source code groups are the unit that qualifies promotions. A group contains one or more source codes, or patterns that match multiple codes, and you associate it with the promotions, price books, and redirects that a valid code unlocks. To create a source code group and set its codes, dates, and redirects, see Define Source Code Groups for B2C Commerce.

A shopper can access a merchant's site using a source code URL provided by an affiliate. In that case, the affiliate's source code activates. When the same shopper exits the site then returns to the site from another source code URL, a new source code replaces the previous one. Replacing source codes allows merchants to limit their overall fiscal exposure in both discounts offered and affiliate payments.

Note
Note Source code groups have their own effective period and enabled flag. If you want to use a source code group as a qualifier, enable the group and validate that the group dates fall within the promotion schedule.

A shopper can provide an individual source code that is part of an active source code group. Then, the shopper qualifies for any active promotion that is associated with that source code group. Only one source code can be active at a time during a session. You can use source codes to control the number and grouping of promotions that a shopper can access at one time.

Source Code Processing of URLs

When B2C Commerce receives a source code as a URL parameter, it validates the code. It checks the existence, enabled status, start date, and end date of the parent source code group.

  • If the source code is active and valid, B2C Commerce stores the current user session and the source code in a cookie.
  • If the source code isn't active and valid, B2C Commerce ignores it and shows the normal landing page.

If no source code is received in the URL but cookies are enabled, the storefront tries reading a source code from a stored cookie. If B2C Commerce can retrieve a source code from a cookie, it validates the source code. The length of time that B2C Commerce stores the source code cookie depends on the cookie duration set for the specific source code group. If no cookie duration is set for the source code group, the cookie duration is set in Business Manager site preferences.

If more than one active source code group contains the source-code, B2C Commerce uses the most recently created group.

Source Code Processing of Shopper Submissions

If you want shoppers to be able to enter source codes into a product page or into the shopping cart, use the B2C Commerce API to validate the source code. If a valid source code is available, B2C Commerce:

  • Enables all promotions that use the source code group as a qualifier
  • Optionally enables a selected price book
  • Optionally redirects the shopper to a product, category, page, or URL

To redirect the shopper, you can:

Source codes that belong to the same source code group get processed in the same way. If the URL contains a second source code parameter, B2C Commerce only evaluates the first parameter and ignores the second. An example of a URL with a second source code parameter:

http://user.dw.demandware.net/on/demandware.store/Sites-YourShopHere-Site/​default/​SourceCodeRedirect-Start?src=ACME&src=KATJA

Because only one source code group can be active at a time, B2C Commerce considers source codes that belong to different source code groups to be inactive. These source codes can be mapped in a similar manner, but to a different product, category, page, or URL.