The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties.
Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
10-Nov-2025
Guide - SPARQUE Recommendations
Document Properties
Kbid
45L579
Added to KB
10-Nov-2025
Status
online
Product
Sparque
Last Modified
10-Nov-2025
Public Access
everyone
Doc Type
Guidelines
Document Link
https://knowledge.intershop.com/kb/45L579

Introduction

This guide describes the steps you need to perform to display SPARQUE recommendations in the PWA.

For this purpose, you need:

  • SPARQUE Desk

  • SPARQUE Wrapper

  • Intershop PWA 9.0.0

  • ICM 14.0.1

References

Product Recommendations based on ICM Order Data

SPARQUE product recommendations can be displayed in the PWA based on order data following these steps:

  1. Export order data from ICM

  2. Use order data in SPARQUE

  3. Display recommendations in the PWA

These are described in more detail in the following sections.

Export Order Data from ICM

  1. Log in to the SMC

  2. Select Schedules | Scheduling

  3. Select Domain inSPIRED-inTRONICS for B2C or inSPIRED-inTRONICS_Business for B2B

  4. Run ExecuteSparqueOrderProcessChain

Process chain for B2C in the SMCProcess chain for B2B in the SMC

The process chain exports orders from ICM without changing their status and pushes the export file to the Azure storage for SPARQUE (sparque4salessolution, sparqueb2c, or sparqueb2b.

The transport can be configured in the Intershop Organization Management for inSPIRED-inTRONICS_Business or inSPIRED-inTRONICS_Business:

Screenshot of the transport configuration for B2CScreenshot of the transport configuration for B2B

For additional technical documentation, see Azure DevOps - icm-as-sparque | ICM Order Data Export to Azure File Storage.

Use ICM Order Data in SPARQUE

To make use of the ICM order data in SPARQUE and serve recommendations via the SPARQUE Wrapper API, create the following artifacts in SPARQUE Desk:

  1. Data Pipeline to define the various recommendation types

  2. Strategy and Endpoint to provide a list of all available recommendation types

  3. Data Pipeline to import the order data

  4. Strategies defining the business logic for each recommendation type

  5. Endpoint for each recommendation type

Step 1 & 2 - Recommendation Types - Data Set, Strategy, and Endpoint

For steps 1 and 2, follow the description in SPARQUE Documentation | Defining Recommendation Strategies and update the result descriptions as shown there.
Ensure that each recommendation type is consistently named and documented so that it is easy to discover via the listing endpoint.

Step 3 - Import Order Data into SPARQUE

Import the order data into the “Intershop Customer Data” Dataset (SPARQUE Documentation | Datasets):

  1. Use the “Fetch a file from URL” option to point to the ICM export stored in Azure.

  2. Start with a simple mapping to create core entities. Expand this mapping as needed for additional strategies.

Example XSLT mapping that derives order, product, user, and customer objects from the exported ICM order file:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:spinque="com.spinque.tools.importStream.EmitterWrapper"
    xmlns:su="com.spinque.tools.importStream.Utils"
    xmlns:ns2="http://www.intershop.com/xml/ns/intershop/order/2.0" extension-element-prefixes="spinque">

    <xsl:output method="text" encoding="UTF-8"/>

    <xsl:variable name="rdfstype">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</xsl:variable>
    <xsl:variable name="host">https://www.sparque.ai/</xsl:variable>
    
    <!-- channel -->
    <!--<xsl:variable name="channelprefix">ish</xsl:variable>-->
    <xsl:variable name="channelprefix">
        <xsl:variable name="channelprefix-after" select="substring-after(//ns2:store, '-')" />
            <xsl:choose>
                <xsl:when test="contains($channelprefix-after, '-')">
                    <xsl:value-of select="substring-before($channelprefix-after, '-')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$channelprefix-after"/>
                </xsl:otherwise>
            </xsl:choose>
    </xsl:variable>

    <xsl:template match="/ns2:order">
        <xsl:variable name="orderID" select="su:uri($host, $channelprefix, 'order', //ns2:document-no)"/>
        <spinque:relation subject="{$orderID}" predicate="{$rdfstype}" object="{$host}Order"/>
        <spinque:relation subject="{$orderID}" predicate="order-channel" object="{su:uri($host, 'channel', $channelprefix)}" />

        <!-- Customer information -->
        <xsl:variable name="customerID" select="su:uri($host, $channelprefix,'customer', ns2:order-header/ns2:customer/ns2:customer-id)"/>
        <spinque:relation subject="{$customerID}" predicate="{$rdfstype}" object="{$host}Customer"/>
        <spinque:relation subject="{$orderID}" predicate="order-customer" object="{$customerID}"/>

        <!-- User Information -->
        <xsl:variable name="userID" select="su:uri($host, $channelprefix, 'user', ns2:order-header/ns2:customer/ns2:user-id)"/>
        <spinque:relation subject="{$userID}" predicate="{$rdfstype}" object="{$host}User"/>
        <spinque:relation subject="{$orderID}" predicate="order-user" object="{$userID}"/>

       <xsl:for-each select="ns2:order-items/ns2:order-item">
            <!-- Lineitem -->
            <xsl:variable name="lineitem" select="su:uri($host, $channelprefix, //ns2:document-no,'lineitem', @id)"/>
            <spinque:relation subject="{$lineitem}" predicate="{$rdfstype}" object="{$host}Lineitem"/>
            <spinque:relation subject="{$lineitem}" predicate="lineitem-order" object="{$orderID}"/>

            <!-- Product Relation -->
            <xsl:variable name="productID" select="su:uri($host, $channelprefix, 'product', ns2:item-product/ns2:product/ns2:sku)"/>
            <spinque:relation subject="{$lineitem}" predicate="lineitem-product" object="{$productID}"/>
        </xsl:for-each>

        <xsl:for-each select="ns2:order-items/ns2:order-item">
            <!-- Product -->
            <xsl:variable name="productID" select="su:uri($host, $channelprefix, 'product', ns2:item-product/ns2:product/ns2:sku)"/>
            <spinque:relation subject="{$productID}" predicate="{$rdfstype}" object="{$host}product"/>
            <spinque:relation subject="{$productID}" predicate="product-order" object="{$orderID}"/>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

Step 4 & 5 - Recommendation Strategies and Endpoints

Top Seller Recommendations

A simple strategy that:

  • Aggregates products across orders

  • Ranks by the number of orders containing each product

  • Returns product data for the top 10 SKUs

The endpoint should be set up like this:

recommendation_best_sold -> OBJ

Product Detail Recommendations

Given a single SKU, this strategy:

  • Finds products most frequently purchased together with the input SKU (same order)

  • Ranks by co-purchase count

  • Returns the top 10 related products

The endpoint should be set up like this:

recommendation_product/p/CurrentProductId/{STRING} -> OBJ

Cart Recommendations

Similar to product detail recommendations, but supports multiple SKUs as input.

Notes:

  • The CartProductIds parameter in the Wrapper’s recommendations endpoint is forwarded to SPARQUE as cartid.

  • You can use cartid flexibly for either cart IDs or product SKUs (as in this example).

The endpoint should be set up like this:

recommendation_basket/p/cartid/{TUPLE_LIST} -> OBJ

Display Recommendations in the PWA

The display of SPARQUE product recommendations is based on the maintenance of the CMS component Product List (SPARQUE Recommendations) in Intershop Commerce Management. You can maintain different components for different strategies.

CMS Recommendations Component Configuration Parameters

Configuration Parameter

Description

Strategy

SPARQUE recommendations strategy

Maximum Product Number

Specifies the maximum number of products to display. If left empty, a maximum of 3 product recommendations are displayed (default defined in SPARQUE).

Title and other display related parameters

Similar to other product list components, e.g., Product List (Category), Product List (Filter), Product List (Manual), or Product List (REST).

Screenshot of component configuration parameters in the ICM

Get Recommendation Strategies for Configuration Parameter Strategy

The list of available recommendation strategies can be determined using the /config endpoint of the REST API of the SPARQUE Wrapper returning the recommendationStrategies, where you need to use the value of strategy, see SPARQUE Documentation | Defining Recommendation Strategies.

Example URL (replace the placeholders with your settings accordingly):
<https://<server>>/api/<version>/config?apiName=<apiName>&channelId=<channelId>&workspaceName=<workspaceName>&Locale=<Locale>

Example Strategies

The following strategies are currently available in the workspace “intershop-project-base-v2”:

Recommendation Type

Strategy

Top Seller Recommendations

recommendation_best_sold

Product Detail Recommendations

recommendation_product

Cart Recommendations

recommendation_basket

Placement Limitations in the PWA

You should place the CMS recommendation components only in areas where the necessary information for the recommendation request is available.

Recommendation Type

Required Information

Description

General recommendations

-

Recommendations can be displayed on any page, e.g., the home page because no specific information is needed.

Product-specific recommendations

product

Product recommendations are only available on product detail pages (URL parameter CurrentProductId is sent to SPARQUE only on product detail pages).

(warning) You need to remove the HTML comments for the View Context to show CMS content in the according Angular component HTML file because the rendering of view contexts is disabled by default, see PWA 5.2.0 release notes.

Category-specific recommendations

category

Category recommendations are only available on a category or family page (URL parameter CategoryId is sent to SPARQUE only on category or family pages).

(warning) You need to remove the HTML comments for the View Context to show CMS content in the according Angular component HTML file because the rendering of view contexts is disabled by default, see PWA 5.2.0 release notes.

Basket-related recommendations

basket

Basket recommendations can be displayed on almost every page if a basket exists and includes items because basket information is globally available in the PWA (URL parameter CartProductIds).

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Website, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Home
Knowledge Base
User Manuals
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.