{ "openapi": "3.0.0", "info": { "title": "VTEX Intelligent Search Events API - Headless (DEPRECATED)", "description": ">⚠️ This API has been deprecated. If your store uses a headless web store or a mobile app built with Flutter or React Native, search impressions and clicks must be tracked manually using Activity Flow for this data to be collected. For implementation details, see [Tracking search analytics events in headless web stores](https://developers.vtex.com/docs/guides/tracking-search-analytics-events-in-headless-web-stores) and [Tracking search analytics events in mobile apps](https://developers.vtex.com/docs/guides/tracking-search-analytics-events-in-mobile-apps).\r\n\r\nIntelligent Search Events API is responsible for collecting the search events to improve your search results, such as page interactions and conversion, in a headless implementation. Some of the features improved by this collection are the possibility to sort the products by clicks or record the top search in the autocomplete.\r\n\r\n>⚠️ **This API applies only to Headless scenarios**. It doesn't apply to stores using Store Framework, since they are already integrated with all Intelligent Search features.\r\n\r\n## Building the request body\r\n\r\nIn the following sections, we explain the required structure for the request body for saving events. Check the `POST` [Save events](https://developers.vtex.com/docs/api-reference/intelligent-search-events-api-headless#post-/event) endpoint reference for more detailed field descriptions and examples.\r\n\r\nFull request example (Session Ping):\r\n\r\n```json\r\ncurl --request post \\\r\n\t--url https://sp.vtex.com/event-api/v1/{accountName}/event \\\r\n\t--header 'Content-Type: application/json' \\\r\n\t--data '{\"session\":\"df66a4d239864d2e8497c89aea14a3ad\",\"anonymous\":\"eed429ecf04a4a23ae7f4429033b48cd\",\"url\":\"https://example.com/search/?query=zapatilha\",\"agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0\",\"type\":\"search.query\",\"text\":\"zapatilha\",\"misspelled\":true,\"match\":392,\"operator\":\"and\"}'\r\n```\r\n\r\n### User identification\r\n\r\nTo identify the user, there are two required identifiers: `session` and `anonymous`.\r\n\r\n- **session**: Identifier related to the current navigation, in UUID v4 format without dashes. The session cookie must be updated with each `session.ping` event, which is essential to determine if a session is active or has been closed. A session is automatically closed after 30 minutes without any `session.ping` event. Events registered for a session that has already been closed by the system are automatically disregarded. The session identifier changes if the user opens another tab in private navigation mode.\r\n\r\n- **anonymous**: Identifier related to the user, in UUID v4 format without dashes. This information is kept in storage for one year. Similar to the session identifier, the anonymous identifier should be renewed to measure returning customers, though the lack of renewal is less critical due to the longer duration of this identifier.\r\n\r\nThese IDs must be generated uniquely and must not be copies of other identifiers or tokens from the platform. We recommend using a [Universally Unique Identifier (UUID) v4](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID) without dashes.\r\n\r\nSample JavaScript code to generate a random UUID without dashes:\r\n\r\n```js\r\nwindow.crypto.randomUUID().replaceAll('-', '')\r\n```\r\n\r\n>⚠️ The `session` and `anonymous` identifiers must be sent in every request.\r\n\r\n\r\n### Event type\r\n\r\nTo identify the events that occur in our search, the `type` field is required in the request. An event always depends on the previous one to be useful. The first two events (Session Ping and Search Query) are essential for basic search report information, suggestion APIs, most searched terms, and part of the relevance criteria composition. The last two events (Search Click and Page Confirmation) complement the search report and relevance criteria.\r\n\r\nFor autocomplete functionality, the Search Autocomplete Query and Search Autocomplete Click events follow a similar pattern: the query event tracks autocomplete searches, and the click event tracks product selections from autocomplete results. These events help improve autocomplete suggestions and track user interactions within the autocomplete feature.\r\n\r\nThe most common event types are the following:\r\n\r\n| Event type | Value | Description |\r\n| - | - | - |\r\n| Session Ping | `session.ping` | Sends an ACK to the API to renew the session server-side. It should be sent every 1 minute. This event is essential to keep the session active. A session is automatically closed after 30 minutes without any `session.ping` event, and events registered for closed sessions are automatically disregarded. |\r\n| Search Query | `search.query` | Sends a query event every time the shopper makes a full-text search. |\r\n| Search Click | `search.click` | Sends an event every time a shopper clicks on a product from a search page. |\r\n| Page Confirmation |`page.confirmation` | Sends a confirmation informing the products that were bought. |\r\n| Search Autocomplete Query | `search.autocomplete.query` | Sends a query event every time the shopper makes an autocomplete search. |\r\n| Search Autocomplete Click | `search.autocomplete.click` | Sends an event every time a shopper clicks on a product from an autocomplete search. |\r\n\r\n### Request body examples per event type\r\n\r\nThe body is built by combining the user information, the event type, and add the optional fields. Below there is an example for each type of event.\r\n\r\n#### Session Ping\r\n\r\n\r\n```json\r\n{\r\n\t\"session\":\"df66a4d239864d2e8497c89aea14a3ad\",\r\n\t\"anonymous\":\"eed429ecf04a4a23ae7f4429033b48cd\",\r\n\t\"url\":\"https://example.com/search/?query=zapatilha\",\r\n\t\"agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0\",\r\n\t\"type\":\"session.ping\"\r\n}\r\n```\r\n\r\n#### Search Query\r\n\r\n```json\r\n{\r\n\t\"session\":\"df66a4d239864d2e8497c89aea14a3ad\",\r\n\t\"anonymous\":\"eed429ecf04a4a23ae7f4429033b48cd\",\r\n\t\"url\":\"https://example.com/search/?query=zapatilha\",\r\n\t\"agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0\",\r\n\t\"type\":\"search.query\",\r\n\t\"text\":\"zapatilha\",\r\n\t\"misspelled\":true,\r\n\t\"match\":392,\r\n\t\"operator\":\"and\"\r\n}\r\n```\r\n\r\n#### Search Click\r\n\r\n```json\r\n{\r\n\t\"type\": \"search.click\",\r\n\t\"product\": \"12345\",\r\n\t\"position\": 1,\r\n\t\"url\": \"https://example.com/s?q=pneu&sort=score_desc&page=0\",\r\n\t\"text\": \"pneu\",\r\n\t\"agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\",\r\n\t\"anonymous\": \"1ce47e50-3f10-4556-95d3-57d4881c03a4\",\r\n\t\"session\": \"51a53ce3-096d-4740-a6d0-3cf86085ba13\"\r\n}\r\n```\r\n\r\n#### Page Confirmation\r\n\r\n```json\r\n{\r\n \"session\":\"df66a4d239864d2e8497c89aea14a3ad\",\r\n \"anonymous\":\"eed429ecf04a4a23ae7f4429033b48cd\",\r\n \"products\": [\r\n {\r\n \"product\": \"ABC123\",\r\n \"price\": 9.99,\r\n \"quantity\": 3\r\n },\r\n {\r\n \"product\": \"XYZ789\",\r\n \"price\": 5.99,\r\n \"quantity\": 2\r\n }\r\n ],\r\n \"order\": \"123ABC\",\r\n \"type\": \"page.confirmation\"\r\n}\r\n```\r\n\r\n#### Search Autocomplete Query\r\n\r\n```json\r\n{\r\n\t\"session\":\"df66a4d239864d2e8497c89aea14a3ad\",\r\n\t\"anonymous\":\"eed429ecf04a4a23ae7f4429033b48cd\",\r\n\t\"url\":\"https://example.com/search/?query=zapatilha\",\r\n\t\"agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0\",\r\n\t\"type\":\"search.autocomplete.query\",\r\n\t\"text\":\"zapatilha\",\r\n\t\"misspelled\":true,\r\n\t\"match\":392,\r\n\t\"operator\":\"and\"\r\n}\r\n```\r\n\r\n#### Search Autocomplete Click\r\n\r\n```json\r\n{\r\n\t\"type\": \"search.autocomplete.click\",\r\n\t\"product\": \"12345\",\r\n\t\"position\": 1,\r\n\t\"url\": \"https://example.com/s?q=pneu&sort=score_desc&page=0\",\r\n\t\"text\": \"pneu\",\r\n\t\"agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\",\r\n\t\"anonymous\": \"1ce47e50-3f10-4556-95d3-57d4881c03a4\",\r\n\t\"session\": \"51a53ce3-096d-4740-a6d0-3cf86085ba13\"\r\n}\r\n```\r\n\r\n### Finding search query information\r\n\r\nSearch query information such as `operator`, `fuzzy`, and `correction` is available in the Intelligent Search API response, which is part of the normal context of a search results page. Check the `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-) endpoint reference for more information.", "contact": {}, "version": "1.0" }, "servers": [ { "url": "https://sp.vtex.com/event-api/v1/{accountName}", "description": "Server URL.", "variables": { "accountName": { "default": "apiexamples", "description": "Name of the VTEX account. Used as part of the URL." } } } ], "paths": { "/event": { "post": { "summary": "Save events", "description": ">⚠️ This API has been deprecated. If your store uses a headless web store or a mobile app built with Flutter or React Native, search impressions and clicks must be tracked manually using Activity Flow for this data to be collected. For implementation details, see [Tracking search analytics events in headless web stores](https://developers.vtex.com/docs/guides/tracking-search-analytics-events-in-headless-web-stores) and [Tracking search analytics events in mobile apps](https://developers.vtex.com/docs/guides/tracking-search-analytics-events-in-mobile-apps).\r\n\r\nCreates search events to integrate with VTEX Intelligent Search using a headless implementation. \r\n\r\nRead [VTEX Intelligent Search Events API - Headless - Overview](https://developers.vtex.com/docs/api-reference/intelligent-search-events-api-headless) for more information on event types and user identification.\r\n\r\n>⚠️ **This API applies only to Headless scenarios**. It doesn't apply to stores using VTEX's storefront solution, since they are natively integrated with Intelligent Search.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", "parameters": [ { "name": "accountName", "in": "path", "description": "Name of the VTEX account. Used as part of the URL.", "required": true, "schema": { "type": "string", "example": "apiexamples" } } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/SessionPing" }, { "$ref": "#/components/schemas/Query" }, { "$ref": "#/components/schemas/Click" }, { "$ref": "#/components/schemas/PageConfirmation" }, { "$ref": "#/components/schemas/AutocompleteQuery" }, { "$ref": "#/components/schemas/AutocompleteClick" } ] }, "examples": { "Session Ping": { "value": { "session": "df66a4d239864d2e8497c89aea14a3ad", "anonymous": "eed429ecf04a4a23ae7f4429033b48cd", "url": "https://example.com/search/?query=zapatilha", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", "type": "session.ping" } }, "Search Query": { "value": { "session": "df66a4d239864d2e8497c89aea14a3ad", "anonymous": "eed429ecf04a4a23ae7f4429033b48cd", "url": "https://example.com/search/?query=zapatilha", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", "type": "search.query", "text": "zapatilha", "misspelled": true, "match": 392, "operator": "and" } }, "Search Click": { "value": { "type": "search.click", "product": "12345", "position": 1, "url": "https://example.com/s?q=pneu&sort=score_desc&page=0", "text": "pneu", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "anonymous": "1ce47e50-3f10-4556-95d3-57d4881c03a4", "session": "51a53ce3-096d-4740-a6d0-3cf86085ba13" } }, "Page Confirmation": { "value": { "session": "df66a4d239864d2e8497c89aea14a3ad", "anonymous": "eed429ecf04a4a23ae7f4429033b48cd", "products": [ { "product": "ABC123", "price": 9.99, "quantity": 3 }, { "product": "XYZ789", "price": 5.99, "quantity": 2 } ], "order": "123ABC", "type": "page.confirmation" } }, "Search Autocomplete Query": { "value": { "session": "df66a4d239864d2e8497c89aea14a3ad", "anonymous": "eed429ecf04a4a23ae7f4429033b48cd", "url": "https://example.com/search/?query=zapatilha", "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", "type": "search.autocomplete.query", "text": "zapatilha", "misspelled": true, "match": 392, "operator": "and" } }, "Search Autocomplete Click": { "value": { "type": "search.autocomplete.click", "product": "12345", "position": 1, "url": "https://example.com/s?q=pneu&sort=score_desc&page=0", "text": "pneu", "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "anonymous": "1ce47e50-3f10-4556-95d3-57d4881c03a4", "session": "51a53ce3-096d-4740-a6d0-3cf86085ba13" } } } } } }, "tags": [ "Events" ], "responses": { "204": { "description": "No Content" } } } } }, "components": { "schemas": { "UserIdentification": { "required": [ "anonymous", "session" ], "properties": { "anonymous": { "type": "string", "title": "anonymous", "description": "Identifier related to the user, in UUID v4 format without dashes. This information is kept in storage for one year. Similar to the session identifier, the anonymous identifier should be renewed to measure returning customers, though the lack of renewal is less critical due to the longer duration of this identifier.", "example": "df66a4d239864d2e8497c89aea14a3ad" }, "session": { "type": "string", "title": "session", "description": "Identifier related to the current navigation, in UUID v4 format without dashes. The session cookie must be updated with each `session.ping` event, which is essential to determine if a session is active or has been closed. A session is automatically closed after 30 minutes without any `session.ping` event. Events registered for a session that has already been closed by the system are automatically disregarded. The session identifier changes if the user opens another tab in private navigation mode.", "example": "eed429ecf04a4a23ae7f4429033b48cd" } } }, "SessionPing": { "title": "SessionPing", "description": "Sends an ACK to the API to renew the session server-side. It should be sent every 1 minute. This event is essential to keep the session active and to determine if a session is ongoing or has been closed. A session is automatically closed after 30 minutes without any `session.ping` event, and events registered for closed sessions are automatically disregarded.", "type": "object", "required": [ "session", "anonymous", "type", "agent" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "session.ping" }, "agent": { "type": "string", "title": "agent", "description": "HTTP User-Agent of the device that made the request.", "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0" }, "device": { "type": "string", "title": "device", "description": "Device type. It can take on one of two values: \"mobile\" or \"desktop\". If specified, it takes precedence over the value specified in agent.", "enum": [ "mobile", "desktop" ] }, "ab": { "type": "string", "title": "ab", "description": "A/B test variant that the shopper is currently participating in. It is used to determine which variant of an A/B test the shopper saw when the event occurred. This property is optional, and its value is not predefined, as it is specific to each A/B test." }, "vtexSession": { "type": "string", "title": "vtexSession", "description": "Current navigation session using the VtexRCSessionIdv7 cookie." }, "vtexMac": { "type": "string", "title": "vtexMac", "description": "Anonymous shopper information using the VtexRCMacIdv7 cookie." } } }, "PageCart": { "title": "PageCart", "description": "Sends an event every time the shopper enters the cart page. Each interaction should include all products inside the shopping cart at that time. In case a product is removed, sent the updated card.", "type": "object", "required": [ "session", "anonymous", "type", "products" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "products": { "type": "array", "title": "products", "description": "Array of objects containing products. If the event type is `page.cart`, the array contains all the products in the cart, with their ID and quantity. Each interaction should include all products inside the shopping cart at that time. In case a product is removed, sent the updated card. If there are no products in the cart (page.`empty_cart`), the array is empty. If the event type is `page.confirmation`, the array contains all the products that were purchased, with their ID, price and quantity.", "items": { "$ref": "#/components/schemas/CartProduct" } }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "page.cart" } } }, "PageEmptyCart": { "title": "Empty Cart", "description": "Sends an event if there are no products in the shopping cart at that time.", "type": "object", "required": [ "session", "anonymous", "type", "products" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "products": { "type": "array", "title": "products", "description": "Array of objects containing products. If the event type is `page.cart`, the array contains all the products in the cart, with their ID and quantity. Each interaction should include all products inside the shopping cart at that time. In case a product is removed, sent the updated card. If there are no products in the cart (page.`empty_cart`), the array is empty. If the event type is `page.confirmation`, the array contains all the products that were purchased, with their ID, price and quantity.", "items": { "$ref": "#/components/schemas/CartProduct" } }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "page.empty_cart" } } }, "PageConfirmation": { "title": "Page Confirmation", "description": "Sends a confirmation informing the products that were bought.", "type": "object", "required": [ "session", "anonymous", "type", "order", "products" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "products": { "type": "array", "title": "products", "description": "Array of objects containing products. If the event type is `page.cart`, the array contains all the products in the cart, with their ID and quantity. Each interaction should include all products inside the shopping cart at that time. In case a product is removed, sent the updated card. If there are no products in the cart (page.`empty_cart`), the array is empty. If the event type is `page.confirmation`, the array contains all the products that were purchased, with their ID, price and quantity.", "items": { "$ref": "#/components/schemas/OrderProduct" } }, "order": { "type": "string", "title": "order", "description": "Order ID.", "example": "123ABC" }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "page.confirmation" } } }, "Click": { "title": "Search Click", "description": "Sends an event every time a shopper clicks on a product from a search page.", "type": "object", "required": [ "type", "product", "position", "text", "anonymous", "session" ], "properties": { "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "search.click" }, "product": { "type": "string", "description": "Unique identifier of the product that the user clicked on.", "example": "12345" }, "position": { "type": "integer", "description": "Position of the clicked product on the search results page. This is useful to identify which product was clicked in case there are multiple products displayed on the same page. The position should start at 0 for the first product in the list.", "example": 1 }, "page": { "type": "string", "title": "page", "description": "Page number on which the clicked product was displayed. This is useful in case there are multiple pages of search results, allowing to identify on which page the click happened." }, "clickType": { "type": "string", "title": "clickType", "description": "Type of click event." }, "url": { "type": "string", "title": "url", "description": "URL that identifies from which page the event occurred.", "example": "https://example.com/s?q=pneu&sort=score_desc&page=0" }, "text": { "type": "string", "title": "text", "description": "Query used in the search.", "example": "tv" }, "agent": { "type": "string", "title": "agent", "description": "HTTP User-Agent of the device that made the request.", "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0" }, "device": { "type": "string", "title": "device", "description": "Device type. It can take on one of two values: \"mobile\" or \"desktop\". If specified, it takes precedence over the value specified in agent.", "enum": [ "mobile", "desktop" ] }, "ab": { "type": "string", "title": "ab", "description": "A/B test variant that the shopper is currently participating in. It is used to determine which variant of an A/B test the shopper saw when the event occurred. This property is optional, and its value is not predefined, as it is specific to each A/B test." }, "vtexSession": { "type": "string", "title": "vtexSession", "description": "Current navigation session using the VtexRCSessionIdv7 cookie." }, "vtexMac": { "type": "string", "title": "vtexMac", "description": "Anonymous shopper information using the VtexRCMacIdv7 cookie." }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" } } }, "Query": { "title": "Search Query", "description": "Sends a query event every time the shopper makes a full-text search.", "type": "object", "required": [ "session", "anonymous", "type", "text", "operator" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "url": { "type": "string", "title": "url", "description": "URL that identifies from which page the event occurred.", "example": "https://example.com/search/?query=zapatilha" }, "agent": { "type": "string", "title": "agent", "description": "HTTP User-Agent of the device that made the request.", "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0" }, "device": { "type": "string", "title": "device", "description": "Device type. It can take on one of two values: \"mobile\" or \"desktop\". If specified, it takes precedence over the value specified in agent.", "enum": [ "mobile", "desktop" ] }, "ab": { "type": "string", "title": "ab", "description": "A/B test variant that the shopper is currently participating in. It is used to determine which variant of an A/B test the shopper saw when the event occurred. This property is optional, and its value is not predefined, as it is specific to each A/B test." }, "vtexSession": { "type": "string", "title": "vtexSession", "description": "Current navigation session using the VtexRCSessionIdv7 cookie." }, "vtexMac": { "type": "string", "title": "vtexMac", "description": "Anonymous shopper information using the VtexRCMacIdv7 cookie." }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "search.query" }, "text": { "type": "string", "title": "text", "description": "Query used in the search.", "example": "tv" }, "misspelled": { "type": "boolean", "nullable": true, "title": "misspelled", "description": "Indicates whether the search query has any spelling mistakes or not. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "example": true }, "match": { "type": "number", "title": "match", "description": "Number of products retrieved by the search query. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "example": 396 }, "products": { "oneOf": [ { "type": "array", "title": "products", "description": "List of product IDs contained in a search result page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "items": { "type": "string", "description": "Product ID." } }, { "type": "array", "title": "products", "description": "List of products contained in a search result page with their positions. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "items": { "type": "object", "description": "Object containing product information.", "required": [ "id", "local", "global" ], "properties": { "id": { "type": "string", "description": "Unique identifier of the product." }, "local": { "type": "number", "description": "Position in the current page." }, "global": { "type": "number", "description": "Position in the result set." } } } } ] }, "page": { "type": "number", "title": "page", "description": "Index of the current page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-)." }, "count": { "type": "number", "title": "count", "description": "Number of products returned per page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-)." }, "locale": { "type": "string", "title": "locale", "description": "Shopper's locale." }, "operator": { "type": "string", "title": "operator", "description": "Identifies the type of operator used on the search.", "enum": [ "and", "or" ], "example": "and" } } }, "AutocompleteClick": { "title": "Autocomplete Click", "description": "Sends an event every time a shopper clicks on a product from an autocomplete search.", "type": "object", "required": [ "type", "product", "position", "text", "anonymous", "session" ], "properties": { "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "search.autocomplete.click" }, "product": { "type": "string", "description": "Unique identifier of the clicked product.", "example": "12345" }, "position": { "type": "integer", "description": "Position of the clicked product within the list of search results. This is useful to identify which product was clicked in case there are multiple products displayed on the same page. The position should start at 0 for the first product in the list.", "example": 1 }, "page": { "type": "string", "title": "page", "description": "Page number on which the clicked product was displayed. This is useful in case there are multiple pages of search results, allowing to identify on which page the click happened." }, "clickType": { "type": "string", "title": "clickType", "description": "Type of click event." }, "url": { "type": "string", "title": "url", "description": "URL that identifies from which page the event occurred.", "example": "https://example.com/s?q=pneu&sort=score_desc&page=0" }, "text": { "type": "string", "title": "text", "description": "Query used in the search.", "example": "tv" }, "agent": { "type": "string", "title": "agent", "description": "HTTP User-Agent of the device that made the request.", "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0" }, "device": { "type": "string", "title": "device", "description": "Device type. It can take on one of two values: \"mobile\" or \"desktop\". If specified, it takes precedence over the value specified in agent.", "enum": [ "mobile", "desktop" ] }, "ab": { "type": "string", "title": "ab", "description": "A/B test variant that the shopper is currently participating in. It is used to determine which variant of an A/B test the shopper saw when the event occurred. This property is optional, and its value is not predefined, as it is specific to each A/B test." }, "vtexSession": { "type": "string", "title": "vtexSession", "description": "Current navigation session using the VtexRCSessionIdv7 cookie." }, "vtexMac": { "type": "string", "title": "vtexMac", "description": "Anonymous shopper information using the VtexRCMacIdv7 cookie." }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" } } }, "AutocompleteQuery": { "title": "Autocomplete Query", "description": "Sends a query event every time the shopper makes an autocomplete search.", "type": "object", "required": [ "session", "anonymous", "type", "text", "operator" ], "properties": { "session": { "$ref": "#/components/schemas/UserIdentification/properties/session" }, "anonymous": { "$ref": "#/components/schemas/UserIdentification/properties/anonymous" }, "url": { "type": "string", "title": "url", "description": "URL that identifies from which page the event occurred.", "example": "https://example.com/search/?query=zapatilha" }, "agent": { "type": "string", "title": "agent", "description": "HTTP User-Agent of the device that made the request.", "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0" }, "device": { "type": "string", "title": "device", "description": "Device type. It can take on one of two values: \"mobile\" or \"desktop\". If specified, it takes precedence over the value specified in agent.", "enum": [ "mobile", "desktop" ] }, "ab": { "type": "string", "title": "ab", "description": "A/B test variant that the shopper is currently participating in. It is used to determine which variant of an A/B test the shopper saw when the event occurred. This property is optional, and its value is not predefined, as it is specific to each A/B test." }, "vtexSession": { "type": "string", "title": "vtexSession", "description": "Current navigation session using the VtexRCSessionIdv7 cookie." }, "vtexMac": { "type": "string", "title": "vtexMac", "description": "Anonymous shopper information using the VtexRCMacIdv7 cookie." }, "type": { "type": "string", "title": "type", "description": "Type of event, which can be one of the following: `page.cart`, `page.empty_cart`, `search.query`, `page.confirmation`, `session.ping`, `search.click`, `search.autocomplete.query`, or `search.autocomplete.click`.", "example": "search.autocomplete.query" }, "text": { "type": "string", "title": "text", "description": "Query used in the search.", "example": "tv" }, "misspelled": { "type": "boolean", "nullable": true, "title": "misspelled", "description": "Indicates whether the search query has any spelling mistakes or not. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "example": true }, "match": { "type": "number", "title": "match", "description": "Number of products retrieved by the search query. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "example": 396 }, "products": { "oneOf": [ { "type": "array", "title": "products", "description": "List of product IDs contained in a search result page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "items": { "type": "string", "description": "Product ID." } }, { "type": "array", "title": "products", "description": "List of products contained in a search result page with their positions. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-).", "items": { "type": "object", "description": "Object containing product information.", "required": [ "id", "local", "global" ], "properties": { "id": { "type": "string", "description": "Unique identifier of the product." }, "local": { "type": "number", "description": "Position in the current page." }, "global": { "type": "number", "description": "Position in the result set." } } } } ] }, "page": { "type": "number", "title": "page", "description": "Index of the current page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-)." }, "count": { "type": "number", "title": "count", "description": "Number of products returned per page. This value can be retrieved from `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-)." }, "locale": { "type": "string", "title": "locale", "description": "Shopper's locale." }, "operator": { "type": "string", "title": "operator", "description": "Identifies the type of operator used on the search.", "example": "and", "enum": [ "and", "or" ] } } }, "CartProduct": { "type": "object", "description": "Product information.", "required": [ "product", "quantity" ], "properties": { "product": { "type": "string", "description": "Unique identifier for a product in the shopper's shopping cart.", "example": "ABC123" }, "quantity": { "type": "number", "description": "Quantity of the product.", "minimum": 1, "example": 2 } } }, "OrderProduct": { "type": "object", "description": "Product information.", "required": [ "product", "quantity" ], "properties": { "product": { "type": "string", "description": "Unique identifier of the product.", "example": "ABC123" }, "price": { "type": "number", "format": "double", "description": "Price of the product.", "example": 9.99 }, "quantity": { "type": "number", "description": "Quantity of the product that was purchased.", "minimum": 1, "example": 3 } } } } }, "tags": [ { "name": "Events" } ] }