Media entity consent demo video

This project is not covered by Drupal’s security advisory policy.

Enables users to give consent to load external media before they get tracked by external media providers.

This is useful, if you want to respect the privacy of your users when using media entities that load their content from external sources, f.e. YouTube Videos, Tweets, Facebook posts and many more. This module also works out of the box with the new oEmbed functionality of media in core.

How it works

This module will give you a configuration screen, where you can define it's usage based on user role, display mode and per media bundle. You can define which question should be rendered before the external media is shown to give the user a hint what will be loaded. You can also specify a footer that gets rendered unter the loaded external media to inform the user, that confirmation was given before. I also recommend you to link to your privacy policy page, to be transparent. The user's preferences are saved via cookies.

In addition it adds a new block, that can be added to your privacy policy page to let users choose their preferences regarding external media, even if there is no media entity on this page or they have given consent before (in the preview-screen this is the block on the left).

For every enabled media bundle, this module will wrap it and prevent it from being rendered until the user has given consent. The code of the media entity will be rendered dynamically as soon as the user gives consent.

Library management

Since some media providers require external javascript to be loaded in the head or footer of your page (f.e. media_entity_twitter) you can specify which files should be removed from the normal rendering process. Those will then be loaded dynamically as soon as the user has given consent for that media bundle.

media_entity vs media in core

Note: It was built for media in core, so it will not work with media_entity from contrib.

Install via composer

composer require drupal/media_entity_consent

Inspired by the external media handling of tagesschau.de.

Supporting organizations: 
Initial development

Project information

Releases