---
schema_version: "1"
id: 71af2d887b0a378d0cd64078148711ac492bc506c09e7b8aa62a11fe92938c35
title: Source Codes as Promotion Qualifiers for B2C Commerce
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_using_source_codesas_qualifiers.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_using_source_codesas_qualifiers.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b3b629e09ae4f5ba74c05560b5f7e3e98824ad599fcf470128ddd5cf194d3837
description: 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.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# 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](https://help.salesforce.com/s/articleView?id=cc.b2c_defining_source_code_groups.htm&release=264.0.0&type=5 "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.").

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_note.png)

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.](https://help.salesforce.com/s/articleView?id=cc.b2c_specifying_source_code_site_preferences.htm&release=264.0.0&type=5 "Merchants use source codes to track customer activity and the source of incoming visits to a storefront. Salesforce B2C Commerce source-code groups enable you to use this information to manage such things as customer redirects, price books, and campaigns. Specify how you want B2C Commerce to handle source codes via 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](https://help.salesforce.com/s/articleView?id=cc.b2c_url_call_pipeline_start_node_for_source_codes.htm&release=264.0.0&type=5 "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.")
- [Use a Source Code Argument to Dynamically Map the Incoming URL](https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_mapping_of_incoming_url_for_source_codes.htm&release=264.0.0&type=5 "Dynamically map an incoming URL to navigate to a specific page or pages.")

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](https://help.salesforce.com/s/articleView?id=cc.b2c_defining_source_code_groups.htm&release=264.0.0&type=5)**  
    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](https://help.salesforce.com/s/articleView?id=cc.b2c_adding_a_second_incoming_url_for_source_codes.htm&release=264.0.0&type=5)**  
    Map two sets of incoming URLs to the same target for B2C storefronts.
- **[Source Code Example for B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_source_codes_example.htm&release=264.0.0&type=5)**  
    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](https://help.salesforce.com/s/articleView?id=cc.b2c_source_code_best_practices.htm&release=264.0.0&type=5)**  
    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](https://help.salesforce.com/s/articleView?id=cc.b2c_analytics_and_reporting_for_source_codes.htm&release=264.0.0&type=5)**  
    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](https://help.salesforce.com/s/articleView?id=cc.b2c_url_call_pipeline_start_node_for_source_codes.htm&release=264.0.0&type=5)**  
    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](https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_mapping_of_incoming_url_for_source_codes.htm&release=264.0.0&type=5)**  
    Dynamically map an incoming URL to navigate to a specific page or pages.