This article applies only to Sensefuel Search & Recommend implemented using JavaScript.
Sensefuel provides a set of events that reflect user interactions within the search layer. These events can be sent to your Analytics platform, data‑visualization tools, or any system requiring behavioral and operational data.
This document explains:
- The list of available events
- How to subscribe to them
- The format of the event payloads
- A glossary of terminology used in the Sensefuel search layer
1. Retrieving Events
1.1 Principle
To receive events, you must expose a global variable containing:
- The list of events you want to subscribe to
- One or multiple callback functions to execute for each event occurrence
Once configured, Sensefuel will send an event object (detailed in Section 2) to the corresponding handler(s).
1.2 Required Structure
window.sensefuel = {
eventbus: {
'eventName': func1
}
};1.3 Example With Multiple Events and Handlers
window.sensefuel = {
eventbus: {
'eventName': funcN,
'display:keywords': [func1, func2],
':spotlights': func2,
'click:': func3,
':': [func1, func2]
}
};Definitions
| Element | Description |
|---|---|
window.sensefuel | Global exposed variable |
eventbus | Container for all event subscriptions |
eventName | Event identifier (string) |
funcN | Callback function executed on event reception |
Event Name Syntax
An eventName may combine:
- Event type:
click,display,view,search,add_to_cart, etc. - Data context:
products,spotlights,keywords,shortcuts…
Format:
eventType : dataContext
Both parts are optional.
Examples
| Pattern | Meaning |
|---|---|
click:products | All click events on products |
view:spotlights | All spotlight view events |
click:* | All click events |
*:products | All events related to products |
search | All search events |
add_to_cart:products | All add‑to‑cart events |
*:* | All events (catch‑all) |
2. Available Events and Payload Structure
Below is the list of supported events, where they originate, and a description of their data structure.
Event Types Overview
| Event Type | Contexts | Display | Click | Add to Cart | Search |
|---|---|---|---|---|---|
| Search | Keyboard, Voice | ✅ | — | — | ✅ |
| Products | Search listing, Zero results, Recommendation widget | ✅ | ✅ | ✅ | — |
| Spotlights | Search listing, Previewer, Zero results | ✅ | ✅ | — | — |
| Shortcuts | Search listing, Zero results | ✅ | ✅ | — | — |
| Keywords | Zero results | ✅ | ✅ | — | — |
3. Event Details & Examples
3.1 Search Event
Structure
| Field | Type | Description |
|---|---|---|
type | string | Always "search" |
origin | string | "keyboard" or "voice" |
data.search_term | string | User’s typed term |
data.results | integer | Number of returned results |
data.store_id | string | Store identifier |
data.search_id | string | Unique search ID |
Example
{
"type": "search",
"origin": "keyboard",
"data": {
"search_term": "dress",
"results": 124,
"store_id": "A2A45",
"search_id": "A1"
}
}3.2 Product Events (display / click)
Structure
| Field | Type | Description |
|---|---|---|
type | string | "display" or "click" |
context | string | "products" |
origin | string | "search_listing", "zero_results", "recommendation-widget" |
data.items[] | array | List of product objects |
data.search_term | string | Search term |
data.store_id | string | Store identifier |
data.search_id | string | Search ID |
Example
{
"type": "clicked",
"context": "products",
"origin": "search_listing",
"data": {
"items": [
{
"item_id": "A12SD3",
"item_url": "http://…",
"price": "55.99",
"currency": "€",
"available": "in stock",
"item_name": "woman leather jacket"
}
],
"search_term": "jacket",
"store_id": "A2A45",
"search_id": "A1"
}
}3.3 Add‑to‑Cart Events
Structure
Same as product events, with:
type:"add_to_cart"
Example
{
"type": "add_to_cart",
"context": "products",
"origin": "search_listing",
"data": {
"items": {
"item_id": "A12SD3",
"item_url": "http://…",
"price": "55.99",
"currency": "€",
"available": "in stock",
"item_name": "woman leather jacket"
},
"search_term": "jacket",
"store_id": "A2A45",
"search_id": "A1"
}
}3.4 Spotlights Events
Structure
| Field | Type | Description |
|---|---|---|
type | "display" or "click" | |
context | "spotlights" | |
sub_context | "branded" or "event" | |
origin | "search_listing", "previewer", "zero-results" |
Example
{
"type": "clicked",
"context": "spotlights",
"sub_context": "branded",
"origin": "search_listing",
"data": {
"items": [
{
"item_id": "branded_spotlight_2",
"title": "spotlight name"
}
],
"search_term": "jacket",
"search_id": "A1"
}
}3.5 Shortcuts Events
Structure
| Field | Type |
|---|---|
type | "display" or "click" |
context | "shortcuts" |
origin | "search_listing", "previewer", "zero-results" |
Example
{
"type": "clicked",
"context": "shortcuts",
"origin": "previewer",
"data": {
"items": [
{
"item_name": "How to clean your leather jacket"
}
],
"search_term": "jacket",
"search_id": "A2"
}
}3.6 Keywords Events
Structure
| Field | Type |
|---|---|
type | "display" or "click" |
context | "keywords" |
origin | "zero-results" |
Example
{
"type": "clicked",
"context": "keywords",
"origin": "zero-results",
"data": {
"items": [
{ "term": "leather jacket" }
],
"search_term": "leather",
"search_id": "A1"
}
}4. Glossary
Search Layer
Sensefuel’s dynamic search interface, composed of:
- Previewer (header section)
- Search results listing
Previewer Elements
- Suggested terms (keywords)
- Suggested product categorizations (based on catalog
product_type) - Spotlights
- Showcases
- Shortcuts
- Content blocks
- Filters & sorting
The exact UI depends on your product version:
- Sensefuel Max
- Sensefuel Ignition