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 to understand how source codes work in the storefront.

  1. Click App Launcher App Launcher, 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.
    ID The ID of the Source-Code Group (for example, GARDEN)
    Description A meaningful description of the source-code group.
    Start Date The first date that the source-code group is valid; an unspecified start date means that the source-code group is available immediately.
    End Date The last date that the source code group is valid; an unspecified end date means that the source-code group is valid indefinitely.
    Cookie Duration in Days 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: site | Site Preferences | Source-Codes module is used.
    Enabled If checked, indicates that the source-code group is active; unchecked indicates that the source-code group is inactive.
    Campaigns Click Edit to assign a source code group to an entire campaign.
    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:
    ? Matches any single alpha-numeric character; for example, the specification 'ABC?' matches ABCD and ABC3, but not ABCDE.
    * Matches any sequence of alpha-numeric characters; for example, the specification 'ABC*' matches ABCD, ABCDE and ABC123.
    [n1...n2] Matches any number between n1 and n2, inclusive; for example, the specification 'ABC[3..22]' matches ABC3, ABC4 and ABC22, but not ABC33 or ABCD.
  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.