---
title: Omnichannel Recommendations Action Requests
slug: engine-api/recs-actions
description: Examples of Monetate Engine API requests for Omnichannel experiences configured with Product Recommendations actions
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-05-15T18:02:48.977Z
---

When selecting [recommendation strategies](https://docs.monetate.com/docs/create-a-recommendation-strategy) for this type of action, be aware of the following conditions related to the [recommendation algorithm](https://docs.monetate.com/docs/recommendation-algorithms) configured as part of the recommendation strategy:

- When using the [Most Viewed (Product Detail Page)](https://docs.monetate.com/docs/recommendation-algorithms#most-viewed-product-detail-page-), [Top Selling by Purchase Count](https://docs.monetate.com/docs/recommendation-algorithms#top-selling-by-purchase-count), [Top Selling by Gross Revenue](https://docs.monetate.com/docs/recommendation-algorithms#top-selling-by-gross-revenue), or other [noncollaborative recommendation algorithm](https://docs.monetate.com/docs/recommendation-algorithms#noncollaborative-standard-algorithms), you don't need to send any product-specific information in the request.
- When using the [Viewed and Also Viewed](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-also-viewed) or other [collaborative recommendation algorithms](https://docs.monetate.com/docs/recommendation-algorithms#collaborative-standard-algorithms), the option selected from **[Base Recommendation on](https://docs.monetate.com/docs/create-a-recommendation-strategy#select-base-rec-on-step)** determines what context events you must include in the request.

The following table contains guidance for which context events you must include in the request when the recommendation strategy uses a collaborative recommendation algorithm, based on the option selected from **Base Recommendation on** in the strategy configuration.

| **Base Recommendation on**             | **Event Required**                                                                                                                             |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Item(s) viewed on current page         | [monetate\:context\:ProductDetailView](docId:0QyZqPaP6DHh9e-BNP6iY) or [monetate\:context\:ProductThumbnailView](docId:9VI5lbVf0klH3Qj6Xa2-E)  |
| First item viewed on current page      | [monetate\:context\:ProductDetailView](docId:0QyZqPaP6DHh9e-BNP6iY) or [monetate\:context\:ProductThumbnailView](docId:9VI5lbVf0klH3Qj6Xa2-E)  |
| Last item viewed in any session        | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Item(s) viewed in past sessions        | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Item(s) currently in the cart          | [monetate\:context\:Cart](docId\:CCLZbgZdAjWM9HubH3fBi)                                                                                        |
| Abandoned cart items in past sessions  | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Last item carted in any session        | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Item(s) purchased in current session   | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Item(s) purchased in previous sessions | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Last item purchased in any session     | No additional events required so long as the customer's unique identifier is associated with a previous completed purchase                     |
| Item group ID(s) in custom variable    | [monetate\:context\:CustomVariables](docId\:qWXOawFdBWNX4Zarj-hAh)                                                                             |

See [User Identity Persistence in Requests](docId:7M254uPWksja-XLMmy6m4) for more information about passing unique identifiers for customers in Engine API requests.

## Request Examples for Noncollaborative Standard Algorithms

This request example is for an Omnichannel recommendations action configured with recommendation strategies that use the [Most Viewed (Product Detail Page)](https://docs.monetate.com/docs/recommendation-algorithms#most-viewed-product-detail-page-), [Top Selling by Purchase Count](https://docs.monetate.com/docs/recommendation-algorithms#top-selling-by-purchase-count), or [Top Selling by Gross Revenue](https://docs.monetate.com/docs/recommendation-algorithms#top-selling-by-gross-revenue) recommendation algorithm.

:::CodeblockTabs
Example Request for Omnichannel Recs Action Using a Noncollaborative Algorithm

```json
{
  "channel": "a-927c8120/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "11111",
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "188.221.179.186"
    },    
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com",
      "pageType": "Index"
    }
  ]
}
```
:::

## Request Examples for Collaborative Algorithms

This example is for recommendation strategies that use a collaborative recommendation algorithm with recommendations based on **First item viewed on the current page** or **Item(s) viewed on current page**. It includes the `monetate:context:ProductDetailView` event.

:::CodeblockTabs
Example Request for Omnichannel Recs Action Using ProductDetailView Event

```json
{
  "channel": "a-927c8120/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "11111",
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "188.221.179.186"
    },    
    {
      "eventType": "monetate:context:ProductDetailView",
      "products": 
      [        
        {
          "productId": "product72",
          "sku": "product72-large-green"
        }
      ]
    },   
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com",
      "pageType": "ProductPage"
    }
  ]
}
```
:::

Like the previous example, this one is also for recommendation strategies that use a collaborative recommendation algorithm with recommendations based on **First item viewed on the current page** or **Item(s) viewed on current page**. This one, however, includes the `monetate:context:ProductThumbnailView` event.

:::CodeblockTabs
Example Request for Omnichannel Recs Action Using ProductThumbnailView Event

```json
{
  "channel": "a-927c8120/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "11111",
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "188.221.179.186"
    },    
    {
      "eventType": "monetate:context:ProductThumbnailView",
      "products": 
      [
        "123",
        "456",
        "789"
      ]
    }, 
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com",
      "pageType": "Index"
    }
  ]
}
```
:::

This example is for recommendation strategies that use the [Viewed and Also Viewed](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-also-viewed) and the [Viewed and Later Purchased](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-later-purchased) recommendation algorithms based on the last item purchased in any session.

:::hint{type="info"}
You must send the product ID of the last purchase.
:::

:::CodeblockTabs
Example Request for Omnichannel Recs Action Using Viewed and Also Viewed, Viewed and Later Purchased Algorithms

```json
{
  "channel": "a-927c8120/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "11111",
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "188.221.179.186"
    },    
    {
      "eventType": "monetate:context:Purchase",
      "productId": "product43",
      "purchaseId": "123456789",
      "purchaseLines": 
      [        
        {
          "sku": "product72colour2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com",
      "pageType": "Index"
    }
  ]
}
```
:::

This example is for recommendation strategies that use the [Viewed and Also Viewed](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-also-viewed) and the [Viewed and Later Purchased](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-later-purchased) recommendation algorithms based on the last item carted in any session.

:::hint{type="info"}
You must send the product ID of the last item added to the cart.
:::

:::CodeblockTabs
Example Request for Omnichannel Recs Action Using Viewed and Also Viewed, Viewed and Later Purchased Algorithms

```json
{
  "channel": "a-927c8120/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "11111",
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "188.221.179.186"
    },    
    {
      "eventType": "monetate:context:Cart",
      "cartLines": 
      [        
        {
          "sku": "product72colour2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com",
      "pageType": "Index"
    }
  ]
}
```
:::

## Request Best Practices by Implementation Type

If your site uses a [hybrid implementation](docId\:ZFxS45Ymf6aIcWwKKgXcC), keep in mind these best practices when configuring an Omnichannel Product Recommendation action:

- You only have to send product IDs if you base recommendations on a specific product (for example, a recommendation strategy configured with the [Viewed and Also Viewed](https://docs.monetate.com/docs/recommendation-algorithms#viewed-and-also-viewed) recommendation algorithm based on the last item viewed in any session or the first item viewed on the current page).
- [monetate\:context\:ProductDetailView](docId:0QyZqPaP6DHh9e-BNP6iY), [CartLine](docId\:b9j1tdT5i0HOzgHQhcGKP), and [PurchaseLine](docId\:m5p9Si0rhdZLBPkbmucCA) events are obtained from the Monetate tag. You're not required to send these.

If your site uses a [pure Engine API implementation](docId\:ZFxS45Ymf6aIcWwKKgXcC), keep in mind that you must send all `ProductDetailView`, `cartLine`, and `purchaseLine` events.
