Source Code Example for B2C Commerce

A source code is typically provided by the customer via a redirect link found on an affiliate website.

For example, a customer clicks your advertisement on a general retail site, containing a source code; and they’re redirected to a specific page on your site, such as Amazon.com. They’re redirected to your site you are on a general retail site. Using source codes, direct customers to specialized landing pages, featured product detail pages, category lists, and URLs.

The following example explains how to use and test source codes with the SiteGenesis application.

  1. Create a promotion.
    1. Click App Launcher App Launcher, and then select site | Merchant Tools | Online Marketing | Promotion.
    2. Click New.
    3. Select a language and click Apply.
    4. Enter the ID (sourcecode), name (Source code test), enable it, set to searchable, and set exclusivity to NO (can be combined with any promotion).
    5. Click Apply.
    6. Scroll down and specify the promotion class: Product: Without Qualifying Products.
    7. Specify Discount: 50 > Amount Off.
    8. Discounted Products: ID=008884303989.
    9. Click Save.
    10. Click Apply.
  2. Create a campaign and assign the promotion to it.
    1. Click App Launcher App Launcher, and then select site | Merchant Tools | Online Marketing | Campaigns.
    2. Click New and create a campaign (Affiliates).
    3. Enable the campaign.
    4. Click Add Experience and Add Promotion.
    5. Locate and select sourcecode.
    6. Click Apply.
  3. Configure a source code group.
    1. Click App Launcher App Launcher, and then select site | Merchant Tools | Online Marketing | Source Code Groups.
    2. Click New.
    3. Enter ID (scgroup2) click Apply.
    4. Click the Code tab, enter a code in the Source Code specification: SCT[1..10].
    5. Click the Redirects tab. Under Active, select Product and enter the discounted product ID (008884303989)
    6. Click Apply.
  4. Specify the distributor.
    1. Click App Launcher App Launcher, and then select site | Merchant Tools | SEO | Dynamic Mapping. Create a distributor name.
    2. Enter the following: /TANDIST/* p,,,SourceCodeRedirect-Start,,src,{0}. This entry is the distributor.
    3. Click Save.
  5. Change the URL in the SiteGenesis application so that you can see how the source code works.
    1. Open the SiteGenesis application in your browser.
    2. Click App Launcher App Launcher, and then navigate to Womens | Tops.

      The resulting URL looks like this:

      http://xx-dw.demandware.net/s/SiteGenesis/search?cgid=womens-clothing-tops&lang=en_US
    3. In the URL, remove everything after SiteGenesis.

      The resulting URL looks like this:

      http://xx-dw.demandware.net/s/SiteGenesis/
    4. Add the distributor's name and the source code to the URL.

      The resulting URL looks like this:

      http://xx-dw.demandware.net/s/SiteGenesis/SCTST/SCT2
    5. Click Enter.

      You’re redirected to the following page:

      http://xx-dw.demandware.net/on/demandware.store/Sites-SiteGenesis-Site/en_US/Link-Product?pid=008884303989