---
title: "Autocomplete API"
method: POST
path: "/v1/search/autocomplete"
tags: ["Search APIs"]
---

# Autocomplete API

`POST /v1/search/autocomplete`

The Autocompletion API provides real-time, personalized, typo resistant typeahead for your search bar.
You send this API what users are currently typing, and the API returns the complete search query suggestions.

### Personalized typeahead
Personalized typeahead is an extreme example of personalized search. The personalization starts immediately when
users enter even just one character. The typeahead results are personalized so that the entries most likely to drive
conversion for the current user are ranked at the top. Miso will predict what the user is looking for in real-time
based on their interests and past behaviors.

### Basic usage
The request schema of Autocompletion API is similar to that of Search API: you put the search query users typed so
far, and the `user_id` or `anonymous_id` for Miso to identify the current user.
For example, when a user types the first character `r`, you send Miso the following request:
```
POST /v1/search/autocomplete
{
   "q":"r",
   "user_id":"user-123"
}
```

The response will be like:
```javascript
{
  "message": "success",
  "data": {
    "took": 50,
    "miso_id": "e93a6d02-0a7a-11eb-a896-d28586dc1386",
    "completions": {
      "title": [
        {
          "text": "Robin Hood: Prince of Thieves (1991)",
          "text_with_markups": "R<mark>obin Hood: Prince of Thieves (1991)</mark>",
          "product": {
            "product_id": "tmdb-8367"
          }
        },
        {
          "text": "Reservoir Dogs (1992)",
          "text_with_markups": "R<mark>eservoir Dogs (1992)</mark>",
          "product": {
            "product_id": "tmdb-500"
          }
        },
        ...
      ]
    }
  }
}
```
* **took**: the amount of time (in milliseconds) Miso took to answer the query
* **completions**: an dictionary of autocompletion candidates from different sources. By default, we only run
autocompletion against the titles of products, but you can choose to get autocompletion candidates from other fields
using the `completion_fields` parameters.
* **completions.title[].text**: the text of completion candidates
* **completions.title[].text_with_markups**: the completion candidates with the part of text that users
haven't typed yet surrounded by \<mark\> HTML tags.
* **completions.title[].product**: the product record whose title matches the autocompletion candidate. This object can be used to implement direct-to-product links: when they click on the link they will go
directly to the product page instead of the search result page. By default, only the `product_id` field is returned,
 you use `fl` request parameter to get more fields returned in the product object.


### Typo resistance
Miso's autocompletion algorithm accepts up to 4 typos in the query string. For example, users may try to find the
 movie `Robin Hood`, but make two typos in the query, which becomes `robonhood` instead (`robin`->`robon`, and a space is missing).

```
POST /v1/search/autocomplete
{
   "q":"robanhood",
   "user_id":"user-123"
}
```

Miso can still find the movie "*Robin Hood: Prince of Thieves*" as a autocompletion candidate.
```javascript
{
  "message": "success",
  "data": {
    "took": 50,
    "miso_id": "e93a6d02-0a7a-11eb-a896-d28586dc1386",
    "completions": {
      "title": [
        {
          "text": "Robin Hood: Prince of Thieves (1991)",
          "text_with_markups": "Rob<mark>in Hood: Prince of Thieves (1991)</mark>",
          "product": {
            "product_id": "tmdb-8367"
          }
        },
        ...
      ]
    }
  }
}
```

### Completion fields
The auto-completions are made against your product attributes. By default, Miso finds completion candidates from the
`title` field. The `completion_fields` parameter
lets you specify the attributes you want to perform auto-completion for.
For example, the following query will return auto-completion candidates from the `title` and a custom attribute
field:`custom_attributes.director`.
```
POST /v1/search/autocomplete
{
  "q": "rob",
  "user_id": "user-123",
  "completion_fields": [
    "title",
    "custom_attributes.director"
  ]
}
```
The response will be like the following:
```javascript
{
  "message": "success",
  "data": {
    "took": 52,
    "miso_id": "16d95080-0bb0-11eb-948d-66359cf29022",
    "completions": {
      "title": [
        {
          "text": "Robin Hood: Prince of Thieves (1991)",
          "text_with_markups": "Rob<mark>in Hood: Prince of Thieves (1991)</mark>",
          "product": {
            "product_id": "tmdb-8367"
          }
        },
        {
          "text": "RoboCop (1987)",
          "text_with_markups": "Rob<mark>oCop (1987)</mark>",
          "product": {
            "product_id": "tmdb-5548"
          }
        },
        ...
      ],
      "custom_attributes.director": [
        {
          "text": "Robert Z. Leonard",
          "text_with_markups": "<mark>Rob</mark>ert Z. Leonard",
        },
        ...
      ]
    }
  }
}
```

## Request body

- AutocompleteRequest
  - `engine_id` string — The engine you want to get results from. When you have more than one engine, you can use this parameter to specify the specific engine you want to get results from. If not specified, the default engine will be used.
  - `user_id` string — The user who made the query and for whom Miso will personalize the results. For an anonymous visitor, use `anonymous_id` instead.
  - `anonymous_id` string — The anonymous visitor who made the query and for whom Miso will personalize the results. Either `user_id` or `anonymous_id` needs to be specified for personalization to work.
  - `user_hash` string — The hash of `user_id` (or `anonymous_id`) encrypted by your [Secret API Key](#section/Authentication/Secret%20API%20Key). `user_hash` is required to prevent unauthorized API access if you are making API calls with a [Publishable API Key](#section/Authentication/Publishable%20API%20Key). You should generate the user_hash via HMAC scheme: you encrypt the desired user_id (or anonymous_id) with your [Secret API Key](#section/Authentication/Secret%20API%20Key) on your backend server, and then let the front-end code send the generated user_hash to Miso APIs to verify the identity of the API caller. As long as the [Secret API Key](#section/Authentication/Secret%20API%20Key) is kept secret, the user_hash prevents a malicious attacker from making unauthorized API calls or impersonating any of your users. Miso APIs accept the case-incentive "hex digest" of user hash, a sample Python 3 code to generate it on your backend server is as follow: ```python import hashlib import hmac YOUR_MISO_SECRET_API_KEY = "039c501ac8dfcac91" key_bytes = YOUR_MISO_SECRET_API_KEY.encode() user_id = "USER_123" # or anonymous_id user_id_bytes = user_id.encode() user_hash = hmac.new( key_bytes, user_id_bytes, hashlib.sha256).hexdigest() # user_hash is "7eb04da5e..." ``` You can find more examples for other languages in this [Github Gist](https://gist.github.com/thewheat/7342c76ade46e7322c3e)
  - `user_cohort` object — The user cohort you want to cold-start the recommendation with. For example, the following query will make recommendations based on the preferences of the users whose `country="United States"`, and `gender="Female"` in the User Profile dataset. ``` { "user_cohort": { "country": "United States", "gender": "Female" } } ```
  - `rows` integer — Number of search results to return.
  - `type` string — The type of products to return. Use this parameter to make the API return only a certain type of products (see [Product APIs](#operation/content_write_api_v1_products_post)). This is particularly useful for sites that have multiple types of products: For example, on a marketplace site, YOu may model *merchandise* and *store* as two types of *products*. You can then use type parameter to limit the recommendation or search results to return only one kind of them. For instance, the following query will return only *store* products: ``` {"type": "store"} ``` For another example, on a travel website, you might have: *hotel*, *thing to do*, and *restaurant*, three kinds of products. You can use `type` parameter to limit results to one kind of them. For instance, the following query will limit the results to only *hotels* product: ``` {"type": "hotel"} ```
  - `dedupe_product_group_id` boolean — Whether to dedupe product based on `product_group_id`. If `dedupe_product_group_id=true`, Miso will prevent products with the same `product_group_id` from showing multiple times in the search or recommendation results. This is particular useful when one product has multiple variants (for example, different sizes, colors, or materials), and you only want to show this product only once in the search or recommendation results. Miso will then return the variant that is most likely to be of the user's interest.
  - `additional_interactions` union[] — A list of additional interaction records. You can use this fields to simulate user interactions without actually writing them to the interaction dataset.
    - union
      - ProductDetailPageView
        - `type` 'product_detail_page_view', required — Used when a user views the detail page of a product. Viewing a product detail page usually indicates a user is interested in the product to certain degree, especially, when the `duration` of the page view is long. When `duration` of the page view is very short (< 5 seconds), `product_detail_page_view` may indicate neural or negative interest in the product.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Search
        - `type` 'search', required — Used to record a search event with the keywords and filters the user used. What a user searches for is a very powerful signal about their interests and what they will eventually buy or consume, so it is important to capture this information with high fidelity.
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
        - `search` SearchInformation
          - `keywords` string — The search keywords user use. Search keywords are strong signals to users' interests.
          - `filters` object — Dictionary of filters users apply to the search results in the following format: `{"FIELD": ["SELECTION_1", "SELECTION_2"]}`.
      - AddToCart
        - `type` 'add_to_cart', required — Used when a user adds a product into their shopping cart. This is a strong positive signal of the user's interest in the product, and may eventually lead to a purchase.
        - `quantities` union — The quantities of products the user adds to their cart or checks out with. This field should be a list of positive values. Specifically, if `product_ids` is a list of N products, the `quantities` needs to be a list with N numbers as well. If `quantities` are not specified, we will assume the quantity to be 1 for every product. Example: ``` {"quantities": [1, 2]} ```
          - number[]
          - number
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - RemoveFromCart
        - `type` 'remove_from_cart', required — Used when a user removes a product from their shopping cart.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Checkout
        - `type` 'checkout', required — Used when a user enters checks out with a set of products. For an eCommerce site, this is the strongest signal of the user's interest and has a high probability of leading to an eventual purchase.
        - `revenue` number — Total revenue associated with the checkout. The revenue should include generally shipping, tax, etc. that you want to include as part of your revenue calculations.
        - `quantities` union — The quantities of products the user adds to their cart or checks out with. This field should be a list of positive values. Specifically, if `product_ids` is a list of N products, the `quantities` needs to be a list with N numbers as well. If `quantities` are not specified, we will assume the quantity to be 1 for every product. Example: ``` {"quantities": [1, 2]} ```
          - number[]
          - number
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Refund
        - `type` 'refund', required — Used when a user requests a refund of products they bought.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Subscribe
        - `type` 'subscribe', required — Used when a user subscribes a product, for example to receive alerts when the product comes back in stock or if the price drops.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Unsubscribe
        - `type` 'unsubscribe', required — Used when a user unsubscribes a product, for example to stop receiving alerts when the product comes back in stock or if the price drops.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - AddToCollection
        - `type` 'add_to_collection', required — Used when a user adds a product to their personal collection. This is a strong signal of their interest in the product.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - RemoveFromCollection
        - `type` 'remove_from_collection', required — Used when a user removes a product from their personal collection.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Read
        - `type` 'read', required — Used to record when and for how long a user reads a piece of written content.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Watch
        - `type` 'watch', required — Used to record when and for how long a user watches content that is of a video format.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Listen
        - `type` 'listen', required — Used to record when and for how long a user listens to content that is of an audio format.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Like
        - `type` 'like', required — Used to record when a user indicates a `like` for a product.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Dislike
        - `type` 'dislike', required — Used when a user indicates a `dislike` for a product or indicates they would like to not be recommended content or products like this in the future.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Share
        - `type` 'share', required — Used when a user shares a product or piece of content.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Rate
        - `type` 'rate', required — Used when a user gives a rating to a product or piece of content.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
        - `rating` number — The rating the user gave in the range of [0, 5]. This field is only required by the `rate` interaction. As a convention in the RecSys community, a rating >= 3.5 is considered positive, a rating <= 2 is negative, and otherwise a rating is neutral. If you use any other rating scale, please normalize it to a [0, 5] scale.
      - Bookmark
        - `type` 'bookmark', required — Used when a user bookmarks a product.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Complete
        - `type` 'complete', required — Used when a user "complete" a product (e.g. complete a course or a video).
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Feedback
        - `type` 'feedback', required — Used when a user sends feedback on provided results.
        - `question_id` string — A unique identifier representing the specific question for which feedback is being provided.
        - `result_type` string — Indicates the type of result the provided feedback is associated with, e.g., an answer or a suggestion.
        - `value` string — Specifies the user's perspective on the provided result, with possible values being helpful, not helpful, or unselected if the user has not provided any feedback.
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Impression
        - `type` 'impression', required — Used to record when a user saw or was presented with a product or content asset. An impression does not mean a user is interested: for example, if there is an impression for a certain product, but no further interaction occurs with that product, we assume the user is probably not interested in it. For an impression that was generated by Miso's search results or recommendations results, it is important to include the `miso_id` associated with the results so that we know the impression is from Miso
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - ViewableImpression
        - `type` 'viewable_impression', required — When a product or content asset is presented to the user, it is not guarantee that the user will see it. An viewable impression is an impression that is "viewable" by the user. Usually, content asset is considered viewable if more than 50% of its area is visible on screen. You can also use different definition for what is considered viewable. Miso will automatically find the best recommendation as long as the difference between viewable and non-viewable impression is consistant.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Click
        - `type` 'click', required — Used when user clicked on something, and does not belong to any other interaction type.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Submit
        - `type` 'submit', required — Used when a user submits a form or a survey.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - HomePageView
        - `type` 'home_page_view', required — Used when a user views your home page.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - CategoryPageView
        - `type` 'category_page_view', required — Used when a user views a category page for a specific “family” or “group” or products or content. This is a strong indicator of what types category of products or content the user is interested in.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
        - `category` string[] — Categories usually fall in a hierarchy, such as *Home & Garden > Kitchen & Dining > Kitchen Tools & Utensils > Sushi Mats* Use this field to specify the full hierarchical list describing the category the user is viewing. The levels should be listed from broad to narrow: `["TOP_LEVEL_CATEGORY", "SUBCATEGORY_1", "SUBCATEGORY_2", ...]`. This field is only used by the category_page_view interaction type, but this data is very useful for determining the user’s interests. Example: ``` [ "Home & Garden", // TOP_LEVEL_CATEGORY "Kitchen & Dining", // SUBCATEGORY_1 "Kitchen Tools & Utensils", // SUBCATEGORY_2 "Sushi Mats" // SUBCATEGORY_3 ] ```
      - PromoPageView
        - `type` 'promo_page_view', required — Used when a user views a specific promotional or curated marketing page about certain products or content.
        - `duration` number — How long (in seconds) the user stayed on this page, or consumed (listened, read, or watched) a product. This field is optional, but it's very important in scenarios where consumption duration matters, including `product_detail_page_view`, `category_page_view`, `watch`, `listen`, and `read`. For example, if a user only views or consumes a product for less than 5 seconds, that user is probably not interested in the product. On the other hand, if a user stays on a page for a while, it usually means they are seriously engaging with or considering the product. When `duration` is absent, we will use the timestamp of the next interaction to infer a rough duration value. Example: ``` {"duration": 61.5} ```
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - ProductImageView
        - `type` 'product_image_view', required — Used when a user views the image of a product (e.g. to enlarge a product photo).
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
      - Custom
        - `type` 'custom', required — Used when you want to record any other kinds of interactions between users and products.
        - `product_ids` string[] — Products or content the user is interacting with. This field is required by almost all the interaction types. We use `product_ids` to refer to the product / content records that you upload to Miso. Therefore, it is important to keep this consistent between the two datasets. Example: ``` {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]} ```
        - `product_group_ids` string[] — The product groups the user is interacting with. You only need this field if you model product variants using `product_id` and `product_group_id` (see Product API). If so, you should use this field, when a user is interacting with a *product group* rather than a specific product variant, for example, when the user is viewing the master page of a T-shirt (i.e. a product group), but has not selected the specific size or color (i.e. a product variant) yet. In such situations, the `product_id` is not applicable because we only know the user is interested in this T-shirt (a product group), but don't know which particular product variant the user is interested in. Therefore, we use `product_group_ids` to capture such interactions in place of `product_ids`. In the situations where specific `product_ids` are available, for example, when user selected a particular size of the T-Shirt, use `product_ids` instead. Example: ``` {"product_group_ids": ["123ABC"]} ```
        - `user_id` string — Identifies the signed-in user who performed the interaction. We will use `user_id` to link Interaction records to your User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have not signed in, see `anonymous_id`.
        - `anonymous_id` string — A pseudo-unique substitute for the User Id. We use `anonymous_id` to identify a visitor who has not signed in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id` is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.
        - `timestamp` string, date-time — The ISO-8601 timestamp specifying when the interaction occurred. If the interaction just happened, leave it out and we will default to the server's time. If you're importing data from the past, make sure you provide a timestamp. It is recommended to include milliseconds in the timestamp to provide a higher time resolution. Example: ``` {"timestamp": "2018-11-07T00:25:00.073876Z"} ```
        - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance, as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
        - `context` WebBasedContext
          - `campaign` Campaign
            - `name` string — Name of the campaign. Identifies a specific product promotion or strategic campaign. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `source` string — Source of the campaign. Identifies which site sent the traffic. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `medium` string — Medium of the campaign that identifies what type of link was used, such as cost per click or email. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `term` string — Term of the campaign that identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
            - `content` string — Content of the campaign that identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads. Identifies search terms. (see [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          - `truncated_ip` string, ipv4 — User's truncated IP address. We use IP address to determine the country of the users.
          - `locale` string — Locale string of the current session, for example en-US.
          - `region` string — The region/location of the site the user is visiting. This is for sites that serve different regions or markets. You can define your own region keywords, for example, `US East`, `Europe`, `LATM`, etc.
          - `page` Page
            - `url` string, required — Url of the page
            - `referrer` string — Url of the referrer page
            - `title` string — Title of the page
          - `user_agent` string — User agent of the device making the request. We use this to determine if a user is browsing the site on mobile or desktop, and tailor the recommendations and search results accordingly. Example: ``` {"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"} ```
          - `custom_context` object — Dictionary of custom context variables for the current browsing session. You can specify context variables specific to your websites or apps in a `{"KEY":VALUE}` format, where `KEY` must be a string, and `VALUE` can be: * a `bool` * a `string` or an `array of string` * a `number` or an `array of numbers` * an `array of objects` * `null` Miso will take these variables into account when generating recommendations.
        - `custom_action_name` string, required — The name of the custom interaction that you have defined.
  - `fq` string — Defines a query in Solr syntax that can be used to restrict the superset of products to return, without influencing the overall ranking. `fq` can enable users to drill down to products with specific features based on different product attributes For example, the query below limits the search results to only show products whose size is either `M` or `S` and brand is `Nike`: ``` {"fq": "size:(\"M\" OR \"S\") AND brand:\"Nike\""} ``` You can use `fq` to apply filters against your custom attributes as well. For example, the query below limits the search results to only products whose `designer` attribute is `Calvin Klein` ``` {"fq": "attributes.designer:\"Calvin Klein\""} ``` `fq` can also limit search results by numerical range. For example, the following query limits the results to products that have `rating >= 4`. ``` {"fq": "rating:[4 TO *]"} ```
  - `boost_fq` string — Defines a query in Solr syntax that can be used to boost a subset of products to the top of the ranking, or to specific *boost positions* (See `boost_positions` parameter below.) For example, the query below will promote all the relevant products whose brand is `Nike` to the top of recommendation list: ``` { "boost_fq": "brand:\"Nike\"" } ``` For a slightly more complex example, the query below will promote the Nike products which have also been tagged as `ON SALE` to the top of the ranking: ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"" } ``` It is worth mentioning that, Miso will only boost products that are relevant and have high likelihood to convert, and will not boost a low performance product only because it matches the boosting query. Depending on your boosting rules, in certain cases, you would like to prevent recommendation results from being too monotone due to boosting. With Miso, you have two tools to do so. First, you can specify `boost_positions` to place promoted products at specific positions in the ranking. For example, the query below will place boosted products only at the first and fourth places in the ranking (positions are 0-based), and place the remaining products in their original ranking, skipping these two positions. ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"", "boost_positions": [0, 3] } ``` The second tool is `diversification`. `diversification` parameter, on a best-effort basis, will try to maintain a minimum distance between products that have the same attributes. For example, the following query will place products made by the same brand apart from each other. ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"", "diversification": { "brand": {"minimum_distance": 1} } } ```
  - `boost_positions` integer[] — Defines a list of 0-based positions you want to place the boosted products at. For example, the query below will promote products whose brand is `Nike` as the top and second recommendations: ``` { "boost_fq": "brand:\"Nike\"", "boost_positions": [0, 1] } ``` If `boost_positions` is not specified (which is the default behavior), all the boosted products will be ranked higher than the rest of the products.
  - `boost_rule_name` string — Name of the boosting rule. Use this to identify a boosting rule in _boosted_rules in the response
  - `boost_rules` BoostingFilterBase[] — Define a list of boosting rules that will be applied to the search or recommendation results simultaneously. `boost_rules` parameter is particularly useful when you want to boost more than one sets of products, and promote each of them to different positions. For example, the query below will promote products whose brand is `Nike` to the top and second results, and products whose brand is `Adidas` to the third and fourth results: ``` { "boost_rules": [ { "boost_fq": "brand:\"Nike\"", "boost_positions": [0, 1] }, { "boost_fq": "brand:\"Adidas\"", "boost_positions": [2, 3] } ] } ```
    - `boost_fq` string — Defines a query in Solr syntax that can be used to boost a subset of products to the top of the ranking, or to specific *boost positions* (See `boost_positions` parameter below.) For example, the query below will promote all the relevant products whose brand is `Nike` to the top of recommendation list: ``` { "boost_fq": "brand:\"Nike\"" } ``` For a slightly more complex example, the query below will promote the Nike products which have also been tagged as `ON SALE` to the top of the ranking: ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"" } ``` It is worth mentioning that, Miso will only boost products that are relevant and have high likelihood to convert, and will not boost a low performance product only because it matches the boosting query. Depending on your boosting rules, in certain cases, you would like to prevent recommendation results from being too monotone due to boosting. With Miso, you have two tools to do so. First, you can specify `boost_positions` to place promoted products at specific positions in the ranking. For example, the query below will place boosted products only at the first and fourth places in the ranking (positions are 0-based), and place the remaining products in their original ranking, skipping these two positions. ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"", "boost_positions": [0, 3] } ``` The second tool is `diversification`. `diversification` parameter, on a best-effort basis, will try to maintain a minimum distance between products that have the same attributes. For example, the following query will place products made by the same brand apart from each other. ``` { "boost_fq": "brand:\"Nike\" AND tags:\"ON SALE\"", "diversification": { "brand": {"minimum_distance": 1} } } ```
    - `boost_positions` integer[] — Defines a list of 0-based positions you want to place the boosted products at. For example, the query below will promote products whose brand is `Nike` as the top and second recommendations: ``` { "boost_fq": "brand:\"Nike\"", "boost_positions": [0, 1] } ``` If `boost_positions` is not specified (which is the default behavior), all the boosted products will be ranked higher than the rest of the products.
    - `boost_rule_name` string — Name of the boosting rule. Use this to identify a boosting rule in _boosted_rules in the response
  - `geo` GeoQuery
    - `filter` GeoDistanceQuery[] — When set, filter result to include only products within certain geographic range from given point.
      - `lat` number, required — Latitude of the center point, should between 90 and -90
      - `lon` number, required — Longitude of the center point, should between 180 and -180
      - `field` string — Name of the field in product data that holds geographic coordinate. Defaults to `location`
      - `distance` number, required — Distance to center point, in kilometer or mile (according to `distance_unit`)
      - `distance_unit` 'km' | 'mile' — Unit of distance(`km` or `mile`). Defaults to `mile`
    - `boost` GeoDistanceQueryBoost[] — When set, boost products within certain geographic range from given point.
      - `lat` number, required — Latitude of the center point, should between 90 and -90
      - `lon` number, required — Longitude of the center point, should between 180 and -180
      - `field` string — Name of the field in product data that holds geographic coordinate. Defaults to `location`
      - `distance` number, required — Distance to center point, in kilometer or mile (according to `distance_unit`)
      - `distance_unit` 'km' | 'mile' — Unit of distance(`km` or `mile`). Defaults to `mile`
      - `boost_positions` integer[] — Defines a list of 0-based positions you want to place the boosted products at. If `boost_positions` is not specified (which is the default behavior), all the boosted products will be ranked higher than the rest of the products.
  - `q` string, required — The search query users typed so far. Please keep the trailing spaces (if any) intact so that we know whether the user has finished typing the last word or is still typing it. For example, the following query means the user has finished typing the word *Fight*: ``` {"q": "Fight "} ``` On the other hand, the following query means the user has not finished typing the last word *Clu*: ``` {"q": "Fight Clu"} ```
  - `language` string — Two-letter (639-1) language code of the search query. If given, the autocomplete results will be from that specific language. If not given, the autocomplete results will be from the primary language of the environment. Example query: ``` {"language": "en"} ```
  - `min_query_users` integer — Limits the query completion results to *historical queries* that have been made by at least this number of unique users. This parameter has no effect when `completion_fields` does not include `historical_queries`. We do not recommend setting `min_query_users` lower than 5. When `min_query_users` is too small, we might risk showing queries that contain typos or are too personal to the users who made the query.
  - `completion_fields` string[] — Controls the sources of autocompletion candidates. Miso performs autocompletion by matching what the user has typed so far to either the *title* of products or to other *attributes*. By default, we only autocomplete against the value in the `title` field. The `completion_fields` parameter lets you specify the attributes you want to perform autocompletion against. For example, the following query will limit the autocompletion candidates to the `title` and `tags` of products: ``` {"completion_fields": ["title", "tags"]} ``` Autocompletion also works on *custom attributes*. For example, if you have a custom attribute for the `designer_name` of the product, the following query limits autocompletion candidates to only the designer names: ``` {"candidates": ["custom_attributes.designer_name"]} ```
  - `fl` string[] — List of fields to retrieve. For example, the following request retrieves only the `title` field of each product along with the `product_id`, which is always returned. ``` {"fl": ["title"]} ``` You can also match field names by using `*` as a wildcard. For example, the query below retrieves the `title` and any custom attributes under the `attributes` dictionary. ``` {"fl": ["title", "attributes.*"]} ``` The following retrieves all the available fields: ``` {"fl": ["*"]} ``` For the lowest latency, use an empty array to retrieve just the `product_id` field (which is the default). ``` {"fl": []} ```

## Response `200`

Successful Response

- AutocompleteResponse
  - `message` string
  - `data` AutocompleteResponseBody, required — autocomplete api response body: { "completions": [{"text": "", "source": ""}] }
    - `took` integer — Number of milliseconds Miso took to retrieve the results.
    - `miso_id` string, uuid — Miso-generated unique Id for each recommendation or search result. Maintaining this Id for subsequent page views is important to Miso's performance as we use `miso_id` to track and fine-tune the performance of personalization and search results. When a user clicks on a recommendation or search result, you should pass the associated `miso_id` to the next page view, and associate the `miso_id` with the interactions that take place on the page (e.g. `product_detail_page_view`, `add_to_cart`, `add_to_collection`, `like`, etc.). In this way, Miso will learn which recommendations work and which didn't. Example: ``` {"misoId": "123e4567-e89b-12d3-a456-426614174000"} ```
    - `completions` object, required — Autocompletion results.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/askmiso/apis/miso-api.md) · [All operations](https://skmtc.dev/askmiso/apis/miso-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/askmiso/miso-api/revisions/f2fa5ba6025f/schema)
