---
updatedAt: 2026-07-27T10:05:50.000Z
agentTools:
  projectIndex: https://developers.dailymotion.com/v0/llms.txt
---

# Contextual video matching

Create more video inventory with "Contextual video matching"

## Overview

When you don't have dedicated videos for each article on your website, the **contextual video matching feature** of the Dailymotion Player can **automatically pick and embed the most relevant videos for your text content**, saving you time and effort.

When the contextual video matching feature is activated, the Dailymotion's Player **analyzes the context of the page**, including the title and page URL, to **play the most relevant videos**. These videos are sourced from your Organization or from your channel catalog.

Contextual video matching takes over the process of finding the perfect content for each page, and **increases ad revenue** by creating **additional ad opportunities** on your website.

***

## How does it work?

When a **Player with contextual content feature** is embedded on a page, it will **automatically retrieve useful data from that page**, such as:

* **Page URL:** [www.your-website.com/your-article-name/](http://www.your-website.com/your-article-name/)
* **Titles:** we are checking if your page contains `<h1>` then falling back on `<h2>` `<h3>` and `<title>`
* **Content:** the text content of the page

These data are sent by the Player to our recommendation engine to **determine the context of the page**, which in return will send to the Player a selection of **relevant videos to play**.

<Image src="https://files.readme.io/1b663138e565ad6510156a000c869a1869d90bbaec22e67e90a707b85ce9578c-concept-contextual-embed-1024x691.gif" align="center" />

***

## Implement "contextual video matching"

You can easily **activate the contextual video matching feature using the API**.

<Callout icon="👍" theme="okay">
  If you’re not comfortable using the API, you can activate the feature from the **[Dailymotion Studio](https://faq.dailymotion.com/hc/en-us/articles/19886643105554#enable_contextual_video_matching_on_player)**.
</Callout>

### Requirements

Contextual video matching must be implemented on webpages that contain **semantic titles** and **textual content** to ensure relevant recommendations.

<br />

### 1. Create a Player with enable\_contextual\_content

<Callout icon="📘" theme="info">
  ### Authentication & scope:

  Creating a Player requires `manage_players` <Anchor target="_blank" href="https://developers.dailymotion.com/v0/reference/api-scopes">scope</Anchor>.
</Callout>

<Anchor target="_blank" href="https://developers.dailymotion.com/v0/reference/partner-api-create-a-player">**Create a custom Player**</Anchor> which includes the following elements:

* Activate the feature using the field [`enable_contextual_content=true`](https://developers.dailymotion.com/v0/reference/player-fields#enable_contextual_content)
* Choose if the contextual content should be sourced from your `organization` or from your `channel` using [`contextual_content_source`](https://developers.dailymotion.com/v0/reference/player-fields#contextual_content_source). Make sure **videos are uploaded**, no matter which option you choose.
* We recommend enabling **autostart** to reduce loading time (included in code sample below).

**Code example**

```
// Possible values for contextual_content_source: organization or channel
// Using autostart=on is recommended
// Replace <YOUR_CHANNEL_ID> with your own channel ID

curl -X POST -H 'Authorization: Bearer ${ACCESS_TOKEN}'\
       -d 'label=My contextual player'\
       -d 'enable_contextual_content=true'\
       -d 'contextual_content_source=organization'\
       -d 'autostart=on'\
      'https://api.dailymotion.com/user/<YOUR_CHANNEL_ID>/players'
```

<br />

#### **Customization options:**

You can customize the behavior of your contextual video matching using the following options:

* [`enable_contextual_content_fallback`](https://developers.dailymotion.com/v0/reference/player-fields#enable_contextual_content_fallback): Allows the contextual Player to display a fallback video when highly relevant content is not available, ensuring the Player is never empty.
* [`enable_contextual_content_freshness`](https://developers.dailymotion.com/v0/reference/player-fields#enable_contextual_content_freshness): Limits the video selection to recent content only. Use it in combination with [`contextual_content_freshness`](https://developers.dailymotion.com/v0/reference/player-fields#contextual_content_freshness) to define the freshness limit in days.

Simply add these options to your Player configuration.

<br />

### 2. Embed an empty Player on your page

Choose your preferred method to **embed the Player on your page**: either <Anchor target="_blank" href="https://developers.dailymotion.com/v0/docs/player-embed-script-web">Player Embed Script</Anchor> or <Anchor target="_blank" href="https://developers.dailymotion.com/v0/docs/player-library-script">Player Library Script</Anchor>. This feature is not compatible with the iFrame embed method.

Make sure to **remove the video and playlist fields** (`data-video` `video` `data-playlist` or `playlist`) in order to benefit from the contextual video matching feature.

Once integrated, users landing on your page should automatically see the most relevant videos based on the context of the page.

**Code examples**

```html Player Embed Script
// Replace {Player ID} with the ID of the Player created in step 1

<script src="https://geo.dailymotion.com/player/{Player ID}.js"></script>
```
```html Player Library Script
// Replace {Player ID} with the ID of the Player created in step 1

<body>
  <script src="https://geo.dailymotion.com/libs/player/{Player ID}.js"></script>

  <div id="my-dailymotion-player">My Player placeholder</div>

  <script>
    dailymotion
      .createPlayer("my-dailymotion-player")
      .catch((e) => console.error(e));
  </script>
</body>
```

<Callout icon="📘" theme="info">
  ### FAQ:

  Refer to the <Anchor target="_blank" href="https://faq.dailymotion.com/hc/en-us/articles/19886643105554#faq">contextual video matching FAQ</Anchor> for answers to common questions about the feature.
</Callout>

<br />