HCL Commerce Version 9.1.15.0 or later

Enabling the Cookie Contents target in Next.js stores

To use the Cookie Contents target in web activities, modify the manifestCustom.ts file for the e-Marketing Spot widget.

Procedure

  1. Open the file integration/data/custom/MarketingCookieContentTarget/manifestCustom.ts.
  2. Edit the manifestCustom.ts file to add the cookie name with a boolean value of true or false.
    • true: Enable this cookie for the marketing target.
    • false: Disable this cookie for the marketing target.
    For example:
    export const dataMarketingCookieContentTargetManifestCustom:
    { [name: string]: boolean } = {
    mycookiename: true,
    };
  3. Save and close the manifestCustom.ts file.

Results

You can now use the Cookie Contents target in web activities for the Next.js store.

Example

This example explains how to configure a web activity to run on the Next.js store home page eSpot (Home_ProductRec). The web activity recommends specific catalog entries if the WC_SESSION_ESTABLISHED cookie is present and its value is true.

  1. Configure the manifestCustom.ts file to include the following code.

  2. In Management Center, configure the following web activity to run on the Next.js store Home_ProductRec eSpot.

  3. Configure the Cookie Contents target as shown below:

  4. Navigate to the storefront homepage and confirm that the Home_ProductRec eSpot displays the web activity recommended catalog entries when the WC_SESSION_ESTABLISHED=true cookie is set in the browser.