Using Source Codes as Qualifiers

You can use Salesforce B2C Commerce to build rules that activate price books, implement storefront redirects, and enable promotions when a valid source code value is provided. A source code is typically provided by the customer either via a redirect link found on an affiliate website or manually entered in the storefront using a value found on a print catalog. Using source codes, you can direct customers to specialized landing pages, featured product detail pages, category lists, and URLs.

Source-code groups contain one or more source codes that are handled by the storefront in a common way. You can configure a source code group to contain one or more literal source codes or patterns that match multiple codes. You can map multiple codes to the same set of rules (price books, promotions, and redirects) by defining them as part a source code group, while still tracking results on a per source code basis. You can also assign one or more source codes to a campaign, so that all the promotions within that campaign use those source codes.

When a customer accesses the merchant's site using the source code URL provided by the affiliate, the affiliate's source code is activated. When the same customer exits the site, and then returns to it via another source code URL, a new source code replaces the previous one, allowing merchants to limit their overall fiscal exposure in both discounts offered and affiliate payments. When a customer provides an individual source code that is part of an active source code group, they then qualifies for any active promotion that is associated with that source code group.

Note: Because source code groups have their own effective period and enabled flag, it's important to validate that the source code group dates falls within the promotion schedule, and the source code group is enabled if you want to use it as a qualifier.

When a customer provides an individual source code that is part of an active source code group, the customer then qualifies for any active promotion that is associated with that source code group. Because only one source code can be active at a time in a session, you might want to use source codes to control the number and grouping of promotions that a customer can access at one time.

Source Code Processing

URL Submission

When B2C Commerce receives a source code as a URL parameter, it validates the code by checking 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 B2C Commerce doesn't receive a source code in the URL and if cookies are enabled, it attempts to read 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 the source code cookie is stored is determined by the cookie duration set for the specific source code group. If no cookie duration is set for the source code group, the cookie duration 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.

Customer Submission

If you want customers 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:

If you want to redirect the customer, you can:

B2C Commerce processes other source codes that belong to the same source code group in the same manner. If the URL contains a second source code parameter, such as:

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

Then B2C Commerce only evaluates the first parameter and ignores the second.

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.

Related Links

Qualifiers

Creating a Campaign

Creating a Promotion

Source Code Best Practices