The search event should be fired when a visitor makes a search for a product or content.
It is recommended to send the search event with each request unless you are using Eureka in a search-as-you-type experience.
If you are using search-as-you-type, the search event should be sent after the user completes their discovery, such as when they click on a product or navigate to another page.
If the user stops typing and does not interact with facets, sorting, or pagination, you may assume the query is complete and trigger the search event. A 10-second waiting time is recommended to determine when the user has paused long enough to consider the search finalized.
Endpoint
Visit our Postman collection to test this request.
Request Parameters
The search event supports the following properties:
| Attribute Name | Type | Validation | Default | Description |
|---|---|---|---|---|
| referrer | String | Required, url | - | Source URL of the referring page |
| campId | Integer | - | 999999 | A unique identifier assigned to a campaign. Refer to common fields for more details. |
| variationId | Integer | - | 999999 | A unique identifier assigned to a specific variation within a campaign. Refer to common fields for more details. |
| source | String | oneof= - search-popup - search-listing - collection-listing - product-detail - other | Component where the search engine is used | |
| platform | String | Required, oneof= - desktop-web - mobile-web - ios - android - other | - | Platform used by the user |
| integrationType | String | Required, oneof= - api - web | - | Type of integration |
| searchSessionId | String | Required | - | Unique session ID created for the current query. Refer to common fields for more details. |
| userId | String | Required | Default | Unique identifier of the user. It is expected to provide for user-based calculations. |
| query | String | Required | - | Query the user searched with |
| resultCount | Integer | Required, unless no result, min=1 | - | Number of search results returned |
| itemsPerPage | Integer | Required, unless no result, min=1 | - | Number of items per page used in the search request |
| totalPages | Integer | Required, unless no result, min=1 | - | Total number of pages returned by the search |
| currentPage | Integer | Required, unless no result, min=1 | - | Page number where the search results are displayed |
| sorting | String | Required | Relevancy | The sorting method used in the search request. It is the type of sorting object of the search response. Refer to common fields for more details. |
| facets | List of facets | - | - | List of facets of the search. Required if any facet selected. Refer to common fields for more details. |
| products | List of products | Required, unless no result | - | List of products returned by the search Refer to common fields for more details. |
| eventType | String | Required, equals=search | - | Type of event |
| createdAt | String | Required, formatted in RFC3339 | If omitted or invalid, it defaults to the current time | Time when the event is created. Refer to common fields for more details. |
You can view the differences in the updated payload structure in the Common Properties.
For the same searchSessionId, each product must be sent only once. Even if the user interacts with sorting, pagination, or facet filters, the same product should not be sent again within that session. Sending a product a single time per searchSessionId is sufficient.
Example Conceptual Flow
1. User submits a search query
Example: query = "myphone"
A new searchSessionId = "x123" is generated for this search session.
2. First response is returned
Products: myphone 11, myphone 12, myphone 13
The tracking layer should check:
“Have I already sent myphone 11, iphone 12, or iphone 13 for searchSessionId = x123?”
Since nothing has been sent yet:
Send myphone 11, myphone 12, myphone 13
Mark these products as seen for session x123
3. User interacts with the search results
(e.g., changes sorting, navigates to the next page, or applies filters)
This occurs under the same searchSessionId = x123.
The new product list may include previously seen items and new items (e.g., myphone X, myphone 17).
4. Before sending events, filter out previously seen products
Compare the new results with the already-seen set:
{myphone 11, myphone 12, myphone 13}
Only send tracking events for new products that are not in the previously seen set.
Suggested Tips for Search Event Collection
To ensure accurate and efficient search event tracking, the following recommendations should be applied:
Timer-Based Event Triggering
- Each time the user types in the search input or interacts with filters (such as sorting, pagination, or facets) within the search popup, a 10-second timer is triggered.
- If the user performs another action before the 10 seconds elapse, the timer is reset.
- If no interactions occur within 10 seconds, the search event log is sent.
Additional Scenarios Requiring Search Event Logging
A search event should also be sent in the following situations if it has not already been logged:
- When the user clicks a product and navigates to the product page
- On exit intent, if the log has not yet been sent
- When a product is added to the cart
- When the user deletes the entire query (send for the previous query if not yet logged)
- When the user copies and pastes a new query (send for the previous query if not yet logged)
- When the user modifies the query after applying a facet (send for the previous query if not yet logged)
These recommendations ensure that search events are captured reliably without duplication, providing more accurate insights into user behavior.
- Changing the sorting option
- Applying a facet filter
- Pagination
Sample Request
In the example below, you see a sample request along with guidance on modifying the necessary fields. This will help you seamlessly integrate and make the most of the provided configuration.
curl --location --request POST 'https://eurekaevent.api.useinsider.com/api/v1/events' \
--header 'x-auth-token: YOUR_AUTH_TOKEN' \
--header 'x-partner-config-key: YOUR_PARTNERID-YOUR_LOCALE' \
--header 'Content-Type: application/json' \
--data-raw '{
"referrer": "https://example.com/homepage",
"source": "search-listing",
"userId": "user-12345",
"platform": "desktop-web",
"campId": 999999,
"variationId": 999999,
"query": "laptop",
"searchSessionId": "search-session-abc123",
"resultCount": 25,
"itemsPerPage": 10,
"totalPages": 3,
"currentPage": 1,
"sorting": "Relevancy",
"facets": [
{
"label": "Price",
"field": "price_en",
"values": ["500", "2000"]
},
{
"label": "Brand",
"field": "brand_en",
"values": ["Apple", "Dell", "HP"]
}
],
"products": [
{
"id": "product-001",
"groupCode": "laptop-group-1",
"price": 1299.99,
"convertedPrice": 1199.99,
"currency": "USD",
"preferredCurrency": "EUR",
"searchPosition": 1
},
{
"id": "product-002",
"groupCode": "laptop-group-2",
"price": 899.99,
"convertedPrice": 829.99,
"currency": "USD",
"preferredCurrency": "EUR",
"searchPosition": 2
}
],
"eventType": "search",
"integrationType": "web",
"createdAt": "2025-11-25T10:30:00Z"
}'