---
schema_version: "1"
id: ecfcaa663de4827631d03d3e0ece3c6435cc39783da2729327895a9e727530a6
title: Define Source Code Groups 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_defining_source_code_groups.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_defining_source_code_groups.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 538623820b4aa2b183a3ddfac54cd8f22ad7f36c81731373d3124ff9f7497319
description: 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.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# 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.

See [Source Code Example](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.") to understand how source codes work in the storefront.

1. Click App Launcher ![App Launcher](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/appLauncher.png), and then select **site** | **Merchant Tools** | **Online Marketing** | **Source Code Groups**.
    
    To perform standard actions such as opening the selection in a new tab or window, right-click links on this grid.
2. Click **New** or locate an existing source code group by clicking **Find**.
    
    Perform a simple search or click **Advanced Search**.
3. On the New/Source-Code Group page, specify the following information.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><tbody><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e97">ID</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e97">The ID of the Source-Code Group (for example, GARDEN)</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e106">Description</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e106">A meaningful description of the source-code group.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e115">Start Date</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e115">The first date that the source-code group is valid; an unspecified start date means that the source-code group is available immediately.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e124">End Date</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e124">The last date that the source code group is valid; an unspecified end date means that the source-code group is valid indefinitely.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e133">Cookie Duration in Days</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e133">The number of days that the cookie is stored in the customer session. If no duration is specified, the cookie duration set for the Business Manager: <span class="menucascade"><strong class="uicontrol"><var>site</var></strong> | <strong class="uicontrol">Site Preferences</strong> | <strong class="uicontrol">Source-Codes</strong></span> module is used.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e156">Enabled</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e156">If checked, indicates that the source-code group is active; unchecked indicates that the source-code group is inactive.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e93-option" id="d177151e165">Campaigns</td><td style="vertical-align:top;" headers="d177151e93-desc d177151e165">Click <strong class="uicontrol">Edit</strong> to assign a source code group to an entire campaign.</td></tr></tbody></table>
    
    If you create a source code group in Salesforce B2C Commerce, B2C Commerce uses the time for the site-specific timezone. But if you import source code groups, B2C Commerce uses the time for UTC/GMT, and not the site timezone. This can cause the source code group to expire before or after you expect, depending on the site’s timezone. The <online-from> / <online-to> tag in the source code groups (XML) export file contains only the date you've set. The time (hr/min) shown in the Business Manager UI won't be exported.
4. Click **Apply** to create (or save) the group. (Click **Save As** to make a copy of the group.)
    
    For example, enter GARDENSPR\* to encompass all source-codes that begin with the literal 'GARDENSPR'. The newly created source-code specification is listed in the table at the bottom of the page. On this page you can also test for matches between source-code specifications and source-code groups, and between source-code specifications and source-codes. To test a source-code specification to see if it encompasses a specific source-code, enter a source-code specification, then a source-code. Click **Test Match**. A message appears indicating whether the source-code matches the specification: `"Source-Code 'GARB3' matches Specification 'GAR*[1..50]'."`. To check if a source-code is contained in the current source-code group, enter only the source-code and click **Test Match**
5. To add source-code specifications to the group, click the **Codes** tab
6. Enter a source code specification and click **Add**. A source-code specification can be a literal source code (made up of alphanumeric characters, with no spaces) or it can include wildcards, such as:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><tbody><tr class=""><td style="vertical-align:top;" headers="d177151e227-option" id="d177151e231"><code>?</code></td><td style="vertical-align:top;" headers="d177151e227-desc d177151e231">Matches any single alpha-numeric character; for example, the specification 'ABC?' matches ABCD and ABC3, but not ABCDE.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e227-option" id="d177151e243"><code>*</code></td><td style="vertical-align:top;" headers="d177151e227-desc d177151e243">Matches any sequence of alpha-numeric characters; for example, the specification 'ABC*' matches ABCD, ABCDE and ABC123.</td></tr><tr class=""><td style="vertical-align:top;" headers="d177151e227-option" id="d177151e255"><code>[n1...n2]</code></td><td style="vertical-align:top;" headers="d177151e227-desc d177151e255">Matches any number between n1 and n2, inclusive; for example, the specification '<code>ABC[3..22]</code>' matches ABC3, ABC4 and ABC22, but not ABC33 or ABCD.</td></tr></tbody></table>
7. To use a source code to redirect the customer to a specific product, category, or URL, click the **Redirects** tab.
8. To associate source codes with custom product attributes, click the **Attributes** tab.
9. To associate a source code group to a specific price book, Ccick the **Price Books** tab.

Associate a source code group with a promotion that is within a campaign. See [Creating a Campaign.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_campaign.htm&release=264.0.0&type=5 "A campaign acts as a wrapper for your promotions and qualifiers. When you create a campaign, define a schedule and qualifiers for an entire group of promotions or slot configurations.")