This article is only relevant for Sensefuel Search & Recommend implemented in Plug & Play.
Objectives
Sensefuel provides events retrieval corresponding to user interactions. You can interface these events to your own Analytics, data visualization or any systems that would need that type of data.
This document presents the different events available and how to retrieve them.
How to retrieve available events
Introduction
You must publish in a global variable the list of all the events you want to retrieve, and the function(s) you will use to handle each occurrence of these events.
Based on it, we will then send you an object which is described in the second part of this document.
You should respect this format:
window.sensefuel = {
eventbus: {
'eventName': func1
}
};
Example:
window.sensefuel = {
eventbus: {
'eventName': funcN,
'display:keywords': [func1, func2],
'*:spotlights': func2,
'click:*': func3,
'*:*': [func1, func2]
}
}
ℹ Where:
- window.sensefuel is the global variable.
- eventbus is the entry.
- eventName is a string corresponding to the event you want to retrieve.
- funcN is a function you provide to handle each occurrence of the event.
eventName can be a combination of an event type (click, display, view, search ...) and a data context (products, spotlights, keywords ...), separated with a « : ». Both the event type and the data context are facultative.
ℹ For instance:
- click: products – receive the click events for products.
- view: spotlights – receive the view events for spotlights.
- click: * receive all click events.
- * : products: receive all events for products.
- search: receive the search events.
- add_to_cart: products – receive the add to cart events for products.
- *:*: receive all events.
Description of available events
You will find in this section the description of the available events, and the format of the object you will receive from us for each event.
| Events | From | Display | Click | |
| Search | Keyboard, Voice | ✅ | ||
| Add to cart | Search listing | ✅ | ||
| Products | Search listing, Zero results, Recommendation widget | ✅ | ✅ | |
| Spotlights | Search listing, Previewer, Zero results | ✅ | ✅ | |
| Shortcuts | Search listing, Zero results | ✅ | ✅ | |
| Keyword | Zero results | ✅ | ✅ |
- search
- display: products
- click: products
- add_to_cart: products
- display: spotlights
- click: spotlights
- display: shortcuts
- click: shortcuts
- display: keywords
- click: keywords
A glossary of specific terms is available in the appendix.
Search event
- type: string – value « search »
- origin: string – value « keyboard » or « voice »
- data:
- search_term: string
- results: integer
- store_id: string
- search_id: string
Example
{
"type": "search",
"origin": "keyboard",
"data": {
"search_term": "dress",
"results": 124,
"store_id": "A2A45",
"search_id": "A1"
}
}
Products
Events display – click
ℹ All the products display events are tracked in the search listing, considering lazy loading of products when scrolling down.
- type: string – value « display » or « click »
- context: string – value « products »
- origin: string – value « search_listing » or « zero_results » or « recommendation-widget »
- data:
- search_term: string
- store_id: string
- search_id: string
- items: array
- item_id: string
- item_url: string
- price: number
- currency: string
- available: string
- item_name: string
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"
}
}
Events add_to_cart
- type: string – value « add_to_cart »
- context: string – value « products »
- origin: string – value « search_listing » or « recommendation-widget »
- data:
- search_term: string
- store_id: string
- search_id: string
- items: array
- item_id: string
- item_url: string
- price: number
- currency: string
- available: string
- item_name: string
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"
}
Spotlights
Events display – click
- type: string – value « display » or « click »
- context: string – value « spotlights »
- sub_context: string – value « branded » or « event »
- origin: string – value « search_listing » or « previewer » or « zero-results »
- data:
- search_term: string
- search_id: string
- items: array
- item_id: string
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"
}
}
Shortcuts
Events display – click
- type: string – value « display » or « click »
- context: string – value « shortcuts »
- origin: string – value « search_listing » or « previewer » or « zero-results »
- data:
- search_term: string
- search_id: string
- items: array
- item_name: string
Example
{
"type": "clicked",
"context": "shortcuts",
"origin": "previewer",
"data": {
"items": [
{
"item_name": "How to clean your leather jacket"
}
],
"search_term": "jacket",
"search_id": "A2"
}
}
Keywords
Events display – click
- type: string – value « display » or « click »
- context: string – value « keywords »
- origin: string – value « zero-results »
- data:
- search_term: string
- search_id: string
- items: array
- term: string
Example
{
"type": "clicked",
"context": "keywords",
"origin": "zero-results",
"data": {
"items": [
{
"term": "leather jacket"
}
],
"search_term": "leather ",
"search_id": "A1"
}
}
Glossary
Plug & Play deployment of Sensefuel on your website enables you to benefit from a search layer and eventually recommendations if you have subscribed to that product too.
The search layer is divided into 2 main parts : the previewer and the search results listing
- The previewer that can be considered as a header of the search layer, and presents the following elements:
- Suggested terms (keyword suggestions)
- Suggested product categorizations (inherited from the product_type attribute provided in the catalog feed to Sensefuel) that filter the search results
- Spotlights
- Showcases
- Shortcuts
- Contents
- Filters & Sort
ℹ The presentation and elements of the previewer can be different according to your product version (Sensefuel Ignition or Max)
From Sensefuel platform, business users can set up Spotlights, Showcases and Shortcuts that will be presented in the search layer
- Spotlights enable users to highlight brands and events
- Showcases enable users to theatricalize and manage product exposure
- Shortcuts enable users to suggest redirection on specific URL based on the keyword typed
Example of Sensefuel Max search layer
Example of Sensefuel Ignition search layer