uses click-tracking both to personalise results for visitors and to show the performance in

Follow these steps to set up click-tracking.

1. Assign Visitor ID's

The first step is to give each visitor a unique ID. The simplest way to do this is by saving a unique, random, 8 letter string in a cookie. Only alpha-numeric strings up to 32 characters are allowed.

A visitor ID should only be unique to the device. Cross-device association is handled automatically by if we detect that a customer ID / email address is used with multiple visitor IDs.

Every time you make an API request you must send the visitor ID from the cookie as the visitor parameter. 

When you have saved the visitor ID, configure Clerk.js to include it:

  <!-- Start of E-commerce Personalisation tool - -->
  <script type="text/javascript">
      var e=d.createElement('script');e.type='text/javascript';e.async=true;
      var s=d.getElementsByTagName('script')[0];s.parentNode.insertBefore(e,s);

    Clerk('config', {
      key: 'STyoUzAmh3JeZvw2LTOyo6CsUOPBtri5',
      visitor: '7t2i2H8l'
  <!-- End of E-commerce Personalisation tool - -->

2. Include Labels in API Calls

Since the dashboard allows you see the performance of each individual part of Search and Recommendations, you should always include the labels parame in each call where you show results.

labels is a list containing at least 1 string, which is the name that will be shown when checking performance in

Full example call with visitor ID and labels:

curl -X POST \
     -H 'Content-Type: application/json' \
     -d '{"key": "STyoUzAmh3JeZvw2LTOyo6CsUOPBtri5",
          "visitor": "7t2i2H8l",
          "limit": 30,
          "labels": ["VisitorRecommendations"]}' \

3. Add Click-Tracking

The click-tracking should be added to all products returned from

Add data-product-id="PRODUCT_ID" to the root element of all products returned from, where PRODUCT_ID is replaced by the actual ID of each product:

<ul class="product-list from-clerk">
  <li class="product" data-clerk-product-id="123">
    <a href="/green-lightsaber">
      <img src="/images/green-lightsaber.jpg" />
      Green Lightsaber
      <button>Add To Basket</button>
  <li class="product" data-clerk-product-id="456">
    <a href="/super-death-star">
      <img src="/images/super-death-star.jpg" />
      Super Death Star
      <button>Add To Basket</button>

Clerk.js will automatically add click-tracking to those elements.

4. Add Sales-Tracking

Finally, if you have not already set it up, you need to track the sales coming from the webshop.

Simply add the following snippet to your Order Success page, and make sure Clerk.js is available on the page:

<script type="text/javascript">
  key: "0bi730epQAlK3Md0nAzzM78zNoEcq5KT",
  sale: "123456",
  email: "",
  customer: "5555",
  products: [
                  "id": 5528,
         "quantity": 1,
   "price": 99.95
         "id": 2952,
         "quantity": 2,
     "price": 9.50

There! Now you have click-tracking running in your API setup.

Did this answer your question?