HCL Commerce Version 9.1.4.0 or later

Troubleshooting

You can verify that the integration between the React Store and HCL Unica Discover is working by using the Developer Tools from your browser.

The steps in the following troubleshooting scenarios are documented for the Developer Tools for the Chrome browser. Open the Chrome browser and use either of the following methods to access the Developer Tools.
  • Open Chrome browser and select Ctrl + Shift + I.
  • Open Chrome browser and go to the Customize and Control menu (three vertical dots). Click More Tools > Developer Tools.

Verifying the REST API result

Verify that the Rest API call is returning Discover in the response by completing the following steps:

  1. Open the store in the Chrome browser and open Developer Tools.
  2. In Developer Tools, go to Network > XHR.
  3. Locate the following API in the Name section: features?langId=-1. You can view the request on the Header tab.
  4. On the Preview tab, view the response and ensure that Discover is returned.

Example: The following example is for the Emerald Reference Store application where the PUBLIC_URL for store is defined as PUBLIC_URL=”/Emerald” in the .env file. In this example, Discover is enabled for the Emerald Reference Store application which has storeId=11.





Verify that discoverui.js is loaded in the browser

Verify that discoverui.js is loaded in the browser by completing the following steps:

Option 1:
  1. Open the store in the Chrome browser and open Developer Tools.
  2. Go to the Console tab and run the following command: DCX.getLibraryVersion();.
  3. The HCL Unica Discover SDK version is returned.
Example: The following example is for the Emerald Reference Store application.

Option 2:
  1. Open the store in the Chrome browser and open Developer Tools.
  2. In Developer Tools, go to the Sources tab.
  3. On the Page tab, expand the store URL > store <PUBLIC_URL> folder. Locate the Discover folder and the discover.js file loaded in the browser.
Example: The following example is for the Emerald Reference Store application.

Option 3:
  1. Open the store in the Chrome browser and open Developer Tools.
  2. In Developer Tools, go to the Network tab.
  3. Filter using "discover" to verify that discoverui.js is fetched from the HTTP server.

Resolving "blocked by CORS policy" browser errors

When HCL Commerce is integrated with HCL Unica Discover, the user data from the store is captured by HCL Unica Discover. The DOM details are sent to the HCL Unica Discover server with the help of the endpoint URL that is configured in the discoverui.js file. When the target endpoint URL (HCL Unica Discover) is from a domain that is different from the store domain, the target endpoint URL POST request might be blocked by the browser. A blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource error occurs.

To resolve any CORS related issues, see the HCL Unica Discover documentation or contact HCL Unica Discover Support.

HCL Unica Discover Replay session issues

The Discover UI SDK generates additional cookies & header data which is included when Discover UI SDK makes a POST request to the target endpoint URL. This information is used while replaying the session in the HCL Discover portal app.

If you encounter any issues related to Discover session replay or regarding additional cookies & header data, see the HCL Unica Discover documentation or contact HCL Unica Discover Support.

Management Center and Rest API logs

If you encounter any issues with enabling or disabling HCL Unica Discover integration with a store from the Management Center, or if any errors or exceptions occur during the GET /wcs/resources/store/{storeId}/features Rest API call, you can find information about these issues in the trace logs of transaction server.

For more information, see Configuring logging for the Transaction server.

Set the following trace strings to capture the relevant logs.

Table 1. Trace strings for Management Center and Rest API logs
Component Trace string
Marketing
com.ibm.websphere.commerce.WC_MARKETING=all
com.ibm.commerce.marketing.*=all
Management Center
com.ibm.commerce.foundation.client.lobtools.*=all
com.ibm.commerce.foundation.logging.*=all