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.
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:
- Format the URL to Call the Start Node of a Pipeline
- Use a Source Code Argument to Dynamically Map the Incoming URL
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.
- Define Source Code Groups for B2C Commerce
Create and configure a source code group in Business Manager, either manually or by import. Set the group's ID, validity dates, and cookie duration, then add the source-code specifications, redirects, and price books it controls. - Add a Second URL with Source Codes for B2C Commerce
Map two sets of incoming URLs to the same target for B2C storefronts. - Source Code Example for B2C Commerce
A source code is typically provided by the customer via a redirect link found on an affiliate website. - Source Code Best Practices for B2C Commerce
Plan the governance around B2C Commerce source code groups: how you educate your marketing team, test promotions before and after go-live, define build-and-release roles and timelines, stage imports, and decide when to use a source-code pattern instead of individual codes. - Source Code Qualifying Promotions Reports for B2C Commerce
The Promotions Source Code Dashboard can help you understand the impact of promotions where users qualify by source codes. - Call a Pipeline Start Node with a Source Code from a URL for B2C Commerce
To start a process at a B2C Commerce storefront, call a pipeline start node from a URL. If a source code is valid, this URL navigates the customer to one of two destinations. A valid source code must be enabled. This feature applies to B2C Commerce. - Dynamic Mapping of URLs with Source Codes for B2C Commerce
Dynamically map an incoming URL to navigate to a specific page or pages.