SAP Commerce Cloud (Hybris)

This is for:

Developer

In this article, we’ll cover the steps involved in installing the Coveo Qubit add-on in SAP Commerce Cloud.

Intro

Our add-on provides a pre-integration with the UK Apparel frontend by injecting logic and tags into the yacceleratorstorefront extension or your custom extension based on this.

This add-on is compatible with version 6.5 of SAP Commerce Cloud. Older versions of the add-on are available for 5.x and 4.x. The add-on may work with later versions but hasn’t been tested so results may not be as expected.

Supported events

The following events are supported by this add-on:

Event Description

ecView

Contains information relating to the type of page currently being viewed

ecUser

Contains information about the current user

ecProduct

Contains information about a product. This can be sent in several different situations

ecBasketItem

Contains information about an item in the basket, including quantity and price. A separate event will be sent for each item in the basket

ecBasketItemAction

Sent when a change is made to an item in the basket (added, removed, quantity updated)

ecBasketItemTransaction

Sent when an order is placed. Contains information about the products ordered

ecBasketSummary

An overall summary of the basket value

ecBasketTransactionSummary

An overall summary of a placed order

Installation

The following installation instructions assume that you already have version 6.5 set up and installed with the B2C Accelerator recipe (b2c_acc), any derivative which includes the B2C Accelerator, or an extension based on yacceleratorstorefront.

Step 1

Unzip the provided file. In the resulting directory, copy the sub-directory qubitaddon to your SAP Commerce Cloud installation’s bin directory

For example:

{COMMERCE_CLOUD}/bin/custom/qubitaddon

Step 2

Add the following line to {COMMERCECLOUD}/config/localextensions.xml_:

<extension name='qubitaddon' />

Step 3

Navigate to {COMMERCECLOUD}/bin/platform_ and execute the following command, replacing [yacceleratorstorefront] with the name of your storefront extension:

ant addoninstall -Daddonnames="qubitaddon" - DaddonStorefront.yacceleratorstorefront=[yacceleratorstorefront]

If no errors are returned, the add-on has been installed to your storefront extension. This will enable the correct tags and population logic to emit Coveo Qubit events.

Configuration

There are several configuration properties that can be defined to set up and alter the behavior of the Coveo Qubit add-on. These are typically defined in your local.properties file located in {COMMERCECLOUD}/config/, although you can also define them in the _project.properties file located in the qubitaddon directory.

Refer to the following table for details of these configuration properties:

Property Expected Value Description

qubit.enabled

true/false

Enable the Coveo Qubit add-on.

qubit.emit.events

true/false

If set to false, no events will be sent to Coveo.

qubit.tracking.id

String

The Id provided to you by Coveo Qubit to uniquely identify your site.

qubit.package

Pro

The package you’ve purchased from Coveo Qubit.

qubit.smartserve.url

String

The URL of smartserve.js. This will be provided to you by Coveo Qubit.

qubit.smartserve.location

Start of HEAD/End of HEAD/End of BODY

The page location to inject smartserve.js.

qubit.smartserve.asynchronous

true/false

If set to true, smartserve.js is loaded asynchronously.

qubit.namespace

String

Controls the namespace for the event (for example, yourshop.ev.product would be configured as yourshop).

qubit.productlistings.events

true/false

If set to true, events will be emitted on product listing pages. Setting this to true could cause performance issues due to the number of events required for some pages in the Hybris Accelerator. This applies to product listing pages and product references.

qubit.productlisting.events.limit

Integer

Maximum number of events per component to send on product listing pages. Use 'null' to specify unlimited.

qubit.productstock.data

true/false

If set to true, stock information is sent with product events. Setting this to true could cause performance issues due to the need to pull back stock information. Hybris wouldn’t normally do this.

qubit.sendbasket.events

true/false

If set to true, basket information is sent on every page. Setting this to true could cause performance issues due to the need to populate basket information on every single page.

Notes

  • Installing this add-on will replace your productreferencescomponent.jsp and master.tag files with default accelerator ones, which include Coveo Qubit specific logic. If you have already changed this JSP or tag, you’ll need to save your changes and make them again after installing the add-on

  • The Basket Data event will be sent with slightly out-of-date information if it’s sent twice from one page, for example, two quantities are modified on the same page. This is because Hybris doesn’t reload the basket data into the Page DOM. The next page will send the event with the correct data

  • Product Reference events may be sent for the same product multiple times on one page if that product appears in multiple reference components, e.g. you might like and complete your look

  • Once this add-on is installed, it’s advisable to either run a system update or initialization, as there’s a new attribute, which will be added to Language to support the different ISO standard Coveo Qubit uses