# YouTube Video Tracking Plugin

Use this JENTIS Tag Manager plugin to track how users interact with embedded YouTube videos. The plugin captures events such as `play`, `pause`, and `resume`, then pushes them to the JENTIS video tracking model: [Video Event Model](/data-capture/web-tracking-setup/set-up-jentis-data-layer/video-interaction-tracking.md).

The YouTube Video Tracker is a plugin, not a connector like Google Analytics or Facebook Conversion API. It does not send data to analytics tools or third parties on its own. Instead, it writes standardized video interaction data to the JENTIS data layer. You can use that data in downstream tools or build your own trigger logic from the values the plugin provides.

{% hint style="info" %}
The plugin can only track videos when it can access the underlying YouTube player events. Some embed methods block that access. In rare cases, a specific combination of website setup and embed code can prevent interaction tracking.
{% endhint %}

### Plugin Generated Data <a href="#plugin-generated-data" id="plugin-generated-data"></a>

This example shows a typical data layer push after a user interacts with a video.

```javascript
window._jts.push({
    track: "video", // JENTIS data layer command
    provider: "youtube",
    start: /* Timestamp when the user started the video. */,
    duration: /* Duration of the currently playing video in seconds. */,
    currenttime: /* Elapsed playback time in seconds. */,
    percent: /* Current playback progress as a percentage. */,
    status: /* Current playback status: play, seek, pause, complete. */,
    url: /* URL of the video. */,
    title: /* Title of the video. */,
    id: /* Unique ID of the video. */
}, true);
```

### Configuration of the YouTube plugin <a href="#configuration-of-the-youtube-plugin" id="configuration-of-the-youtube-plugin"></a>

To enable and configure the plugin, open **JENTIS Tag Manager** and go to **Plugins** → **Add New Plugin**.

<figure><img src="/files/XQcbYnKM3Gwj7QW7ajO5" alt=""><figcaption></figcaption></figure>

Review these six settings:

1. **Track other interactions with the video**: Enable this option to track actions such as `pause`, `seek`, and `buffer`, and push them to the JENTIS data layer. The default interactions `play`, `pause`, and `progress` are controlled by the settings below.
2. **Enable API support and reload videos**: YouTube videos are embedded as iframes. When you enable this option, the plugin checks each video URL for the `enablejsapi=1` query parameter. If the parameter is missing or set to `0`, the plugin updates it and reloads the iframe.
3. **Track start of video**: Enable this option to track the initial start of the video, including autoplay.
4. **\* Bind library to element click**: Some YouTube videos are not available at page load because they only load after a user clicks another element. In that case, tracking cannot start immediately. Enter a valid CSS selector for that clickable element, or leave the field empty if you do not need this behavior. Once the user clicks the element, YouTube tracking starts. Example: `.play-button`
5. **Track end of video**: Enable this option to track when playback reaches the end of the video.
6. **Track progress**: Enable this option to track playback milestones. For example, if you enter `25|50`, the plugin sends an interaction event when the user reaches 25% of the video and again at 50%. Use integers only. Separate values with a pipe character. Do not add spaces.

\ <br>

**Quick guide: create a variable to retrieve YouTube tracking data**

Use these four steps to create a variable for YouTube interaction data. In this example, the variable returns the video title:

1. Create a new variable for a video property, such as the video title.\
   ![](/files/E9xYmGXoZkoDv6GyGXsM)
2. Click **Add New Variable**.
3. Select **Get JTM data layer value**.\
   ![](/files/sP94pKuhg0Kv0enUkaho)
4. Define the properties as follows:
   1. Document name: `video` — this matches the `track` property in the data layer push event.
   2. Property: `title` — this is the value you want to return.
   3. Leave the other properties empty.

\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/jentis-dcp-elements/plugins/youtube-video-tracking-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
