Dailymotion video tracking in Google Tag Manager
New in 2.0.0. Google Tag Manager for WordPress reports how your visitors watch the Dailymotion videos embedded on your site. Starting, pausing, seeking, buffering and finishing become data layer events, and so do changes to the volume, the quality and full screen.
This page describes GTM4WP 2.0.0 and newer. Dailymotion tracking did not exist in the legacy 1.x versions of the plugin.
The option is experimental and carries an Experimental badge in the plugin settings. It rebuilds your embed to make tracking possible, which is described below, so test it on a page you can check before you switch it on everywhere.
Turning Dailymotion tracking on
Open the plugin settings, go to the Media events section, expand the Media players group and check Dailymotion video events. The option is switched off by default.
A second setting, Dailymotion player ID, appears underneath it. It is optional and covered in its own section below.
Your embed is rebuilt, not wrapped
Read this one before you switch the option on, because it changes the markup on your page.
Dailymotion retired the old player integration on 3 February 2026. The script it used still loads, but it only writes a warning to the browser console and no event ever arrives, so anything built on it stopped reporting silently.
Its replacement, the Player Embeds API, cannot listen to a player it did not create. The embed WordPress writes for a Dailymotion URL carries no identifier the API can attach to, and Dailymotion documents that shape as having no API at all. The only way to get events is to build the player instead of borrowing it, so the plugin removes the embed iframe and puts a container in its place for Dailymotion to fill.
The size is carried across, so the video keeps the box it had rather than collapsing. So are the CSS class and any inline style on the embed, which keeps a theme or plugin rule written against it working. What does not survive is anything that only means something on an iframe: the source address, the permissions attributes, the frame border and the title. Dailymotion’s own player brings its own.
If building the player fails, for example because the library could not be loaded, the plugin puts your original embed back exactly as it was. The visitor still sees a working video, it simply goes untracked, and the plugin reports an error player event.
The Dailymotion player ID setting
Because the plugin now builds the player, it also decides which player configuration your visitors get. The Dailymotion player ID setting is how you choose.
Leave it empty and Dailymotion’s default player is used, which needs no account. Fill it in with the ID of a player from the Players tab of your Dailymotion Studio account and that configuration is used instead, so your own branding and controls survive the rebuild. Filling it in is also what silences Dailymotion’s console warning about a player initialized without a player ID.
One case overrides the setting. If an embed already names a player of its own, that player is used for that embed whatever the setting says, so switching tracking on never quietly swaps a player you deliberately chose.
Which embeds are detected
The tracker looks at every iframe whose src contains dailymotion.com or dai.ly, which covers the embed WordPress writes for a pasted link, the older embed address and the short link form.
It then has to find the video ID, which sits in a different place in each of those forms. An embed with no video ID in it at all, such as one pointing at a playlist, is left untouched and untracked rather than guessed at.
The player library is only requested once the tracker has actually found a Dailymotion embed, so a page without one never contacts Dailymotion.
A video that is in the page when it loads is wired straight away. One inserted later, for example in a popup, a lightbox or a section loaded by AJAX, needs the Track dynamically inserted players option in the Advanced group as well.
Playback states
The gtm4wp.mediaPlayerStateChange event fires with these values in the mediaPlayerState variable:
| mediaPlayerState | Fires when |
|---|---|
play | Playback starts, including when the visitor resumes after a pause. |
pause | The visitor pauses the video. |
ended | The video reaches its end. |
seeked | The visitor has finished jumping to another position. |
buffering | Playback stops to wait for more data. |
The seeked state is reported when the seek completes rather than when it starts, so the position it carries is where the visitor landed. Dragging a scrub handle therefore reports one state change at the end rather than a stream of them along the way.
Player events
The gtm4wp.mediaPlayerEvent event carries the name of the event in the mediaPlayerEvent variable and the accompanying value in mediaPlayerEventParam.
| mediaPlayerEvent | mediaPlayerEventParam |
|---|---|
volumechange | The new volume. |
qualitychange | The quality the player switched to. |
fullscreenchange | The presentation mode the player moved into. |
error | The error reported by the player. |
The name fullscreenchange is kept because that is the string sites already build triggers on, but Dailymotion treats full screen and Picture in Picture as one setting. The parameter tells you which mode the player is in, so read it rather than assuming the event means full screen.
What mediaData holds for a Dailymotion video
| Variable | Contents |
|---|---|
mediaData.id | The Dailymotion video ID. |
mediaData.author | The screen name of the channel that published the video. Dailymotion is one of only four players that report this. |
mediaData.title | The title of the video. See the note below about the first few events. |
mediaData.url | The public Dailymotion address of the video. |
mediaData.duration | The length of the video in seconds. |
The mediaType variable is dailymotion in every event.
The title and the channel name only reach the plugin once the player has fetched the video’s own metadata, which happens a moment after the first events. Until then the title reports the video ID instead. An empty title would read in a report as a video that has no title, which is worse than an ID you can recognize.
Google Tag Manager built-in Video variables
Every Dailymotion media event also populates the built-in Video variables of Google Tag Manager, with Video Provider set to dailymotion. The section on built-in Video variables explains how to enable and use them. Video Visible is measured on the container the player sits in.
Building a trigger in Google Tag Manager
To fire a tag when a visitor starts a Dailymotion video:
- Create a Data Layer Variable named
mediaPlayerState. - Create a Custom Event trigger whose event name is
gtm4wp.mediaPlayerStateChange. - Add the condition
mediaPlayerStateequalsplayto the trigger. - Attach the trigger to your tag. To send the title along with it, create a second Data Layer Variable named
mediaData.title.
Limitations
- Your embed is replaced with a player the plugin builds. The size, the CSS class and any inline style are carried across; the iframe’s own attributes are not.
- An embed with no video ID in it, such as a playlist embed, is left untouched and untracked.
- The title and the channel name are missing from the first events of a video, where the title reports the video ID instead.
- The
fullscreenchangeevent covers Picture in Picture as well as full screen. Read the parameter to tell them apart. - There is no 100 percent milestone. Measure a full watch with the
endedstate, as described under playback percentage milestones.
Related pages
The overview of media player tracking describes the events, data layer variables and playback milestones that every player shares. See also Twitch, the other player whose embed is rebuilt, and dynamically inserted players if your videos open in a popup or a lightbox.

