# Because You Watched

> Source: https://docs.recombee.com/recipes/video/fully-personalized-homepage/because-you-watched

> For the complete documentation index, see [llms.txt](/llms.txt).

**Table of contents**

* [Introduction](#introduction)
* [Composite Recommendations Overview](#composite-recommendations-overview)
* [Scenario Setup](#scenario-setup)
* [Logic](#logic)
* [Filters](#filters)
* [Requesting Recommendations](#requesting-recommendations)

# Because You Watched

![](/img/recipes/video/because-you-watched.png) 

## Introduction

The **Because You Watched** scenario ensures your users receive recommendations based on their recent watches. By analyzing their viewing history, we present a carefully curated list of videos that share thematic elements with what your users enjoyed before.

With [Composite Recommendations](/scenarios#composite-recommendations), you can return both:

1. The **source item** (the video the user recently watched), and
2. The **recommended items** (similar titles or related content)

— all in a single API response.

## Composite Recommendations Overview

**Composite Recommendations** combine multiple recommendation steps into one response.  
They are requested via the [**Composite Recommendation API endpoint**](/api#composite-recommendation).

In this use case:

* **Source:** The video the user watched (an _Item_)
* **Result:** Related videos the user is likely to enjoy next

[![Because You Watched Composite Recommendation Example](/img/gui/composite_because_you_watched.png)](/img/gui/composite_because_you_watched.png)

This setup ensures contextual recommendations that feel natural and personalized — “because you watched _X_, you might also like _Y_.”

---

## Scenario Setup

In the Recombee Admin UI, navigate to the **[Scenarios](/scenarios)** section and choose **Create Scenario**.

1. Enter a **Scenario ID**, e.g. `because-you-watched`.
2. Set the **Recommendation Type** to **Composite** (see [Composite Recommendations](/scenarios#composite-recommendations)).
3. Select the **Template:** [video:because-you-watched](/recommendation_logics#video-because-you-watched).

![Admin UI - Composite Scenario Setup](/img/recipes/video/because-you-watched-create-scenario.png)

## Logic

Within the [video:because-you-watched](/recommendation_logics#video-because-you-watched) Logic, you can customize the returned assets in the **Result** section using parameters such as:

* `assetType` – to specify which types of videos to include (e.g., _movies_, _series_, _episodes_).
* `excludeAlreadyWatched` – to filter out content the user has already seen.

![Admin UI - Logic](/img/recipes/video/because-you-watched-logic-result.png)

You can also configure how the watched asset is selected in the **Source** section using:

* `maxDaysAgo` – to specify the maximum number of days since the user watched a video for it to be considered for the “Because” selection.
* `minWatchedPercentage` – to define the minimum portion of a video that must be watched (based on the _View Portion_ interaction) for it to be considered watched by the user.

![Admin UI - Logic](/img/recipes/video/because-you-watched-logic-source.png)

## Filters

Available Assets (Global Settings)

You always want to recommend only movies, series, and episodes that are currently available to watch for your users. Therefore you need to apply a [**Filter**](/scenarios#filters) rule to allow only such assets.

As it would be tedious and prone to error to add this rule to all the Scenarios, this rule shall be added to the [**Global Settings**](/scenarios#scenarios-in-admin-ui-global-settings), so it is always applied everywhere.

**The particular filter depends on how you specify such assets in your catalog:**

* If you have a **boolean property** that marks the asset as available you can use the predefined _Available items \[boolean\]_ rule.
* If you have a **timestamp property** that specifies when the asset is published (becomes available) you can use the predefined _Published items rule_.
* Or if you have a **licensing window (start date, end date)** you can use the predefined _Items within their licensing window_ rule.
* In every other case, you can create a [**custom filter rule**](/reql) to allow only the available assets according to your own logic.

![Admin UI - Global Settings - Filter](/img/recipes/video/filter.png)

## Requesting Recommendations

There are two ways to show multiple personalized rows in your application:

1. **Using the API Client**

Using an [API Client of your choice](/api_clients), you can retrieve _Because You Watched_ recommendations via the **[Composite Recommendation API endpoint](/api#composite-recommendation)**.

For more information navigate to the Integration tab of the Scenario in the Admin UI.

In order to request content for multiple rows with a single API request, use the [Batch endpoint](/api#batch) and put recommendation requests for all rows inside it. Set the parameter `distinctRecomms` in order to [deduplicate the assets among the rows](/api#batch-example-using-distinctrecomms-parameter-to-deduplicate-results-in-multiple-boxes).

1. **Using the Widget SDK**

For web applications built with HTML, CSS and JavaScript, the [Widget SDKs](/widget-sdks) support Composite Recommendations out of the box.

Place a widget on your page, with `createRequest` returning a **[Composite Recommendation request](/api#composite-recommendation)**. Design the row title with the `SourceItemComponent` parameter and the videos inside it with `ItemComponent`.

In order to request content for multiple rows, simply place multiple widgets on the page. These will get deduplicated automatically, for the recommended videos as well as for the _source items_ (the watched videos).

For full code examples and in-depth guidance, see the relevant SDK documentation on Composite Recommendations:

* [Carousel Widget (JS)](/widget-sdks/carousel-widget-js#composite-recommendations)
* [Carousel Widget (React)](/widget-sdks/carousel-widget-react#composite-recommendations)
* [Grid Widget (JS)](/widget-sdks/grid-widget-js#composite-recommendations)
* [Grid Widget (React)](/widget-sdks/grid-widget-react#composite-recommendations)
* [Feed Widget (JS)](/widget-sdks/feed-widget-js#composite-recommendations)
* [Feed Widget (React)](/widget-sdks/feed-widget-react#composite-recommendations)