You are here:
Source Codes as Promotion Qualifiers for B2C Commerce
You can use B2C Commerce to build rules that activate price books, implement storefront redirects, and enable promotions when a valid source code is provided.
Use source codes to create custom URLs that redirect customers to specialized pages. A source code is typically provided by the customer from a redirect link on an affiliate website or manually entered using a value from 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 codes that the storefront handles in a common way. You can configure a source code group to contain one or more source codes or patterns that match multiple codes. You can also map multiple codes to the same set of rules. Define the rules as part the 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.
A customer can access a merchant's site using a source code URL provided by an affiliate. In that case, the affiliate's source code is activated. When the same customer 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 customer can provide an individual source code that is part of an active source code group. Then, the customer 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 customer 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 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 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 Customer Submissions
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:
- Enables all promotions that use the source code group as a qualifier
- Optionally enables a selected price book
- Optionally redirects the customer to a product, category, page, or URL
If you want to redirect the customer, 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=KATJABecause 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
You can define source code groups in Business Manager or by import. In Business Manager, source code groups can represent one or more source-codes or source-code specifications. - Add a Second URL with Source Codes for B2C Commerce
You can 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
Follow these best practices when using source codes for your B2C Commerce storefront. - 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. This topic applies to B2C Commerce. - 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
You can dynamically map an incoming URL to navigate to a specific page or pages.

