Blocking iframes (twitter/youtube...)

Many websites use iframes to display videos, tweets, etc. It is therefore necessary to ask users for their consent before loading the content of the iframe.

Examples of services using iframes

Video players: YouTube, Vimeo, DailyMotion, etc. Social media: Twitter, Facebook, etc. Podcast players Audio players

Method 1: Using the SDK

Our SDK will allow you to block all iframes on the page by displaying a customizable blocking message:

By clicking on “I accept,” consent to the specific service will be automatically dispatched. The system also allows you to capture a refusal of cookies in the Dastra CMP. A simple example with YouTube video player iframes:

You can customize the appearance of the message (background, fonts, etc.) using your CSS sheet. The blocking message is integrated into the page's DOM with a class “.datra-blocking-iframe”.

Method 2: Manual implementation

You can also implement your own logic :

Last updated

Was this helpful?