Guide: Blocking YouTube Videos with biskoui
Introduction
This guide explains how to block YouTube videos until users provide consent, helping you comply with data protection regulations.
Our consent management platform helps you comply with regulations governing the management of video content provided by third-party services.
YouTube Video Integrations and nLPD
Despite being a very common practice due to its ease of use, since September 1, 2023, placing a YouTube video on your website without consent is no longer compliant with privacy regulations.
Why is consent required?
When YouTube videos are embedded on your website, the user's IP address is automatically sent to YouTube servers in the United States as soon as the page is loaded, even if the user does not click on the video.
In addition, the service will also deposit a series of cookies to study user behavior.
An IP address is personal data, and sending it without explicit consent constitutes a violation of the Swiss New Data Protection Act (nLPD) and the European General Data Protection Regulation (GDPR).
By blocking these videos until users give their consent, your website will not only comply with legal obligations, but it will also boost user confidence by demonstrating a commitment to their privacy.
How Does biskoui Block YouTube Videos?
biskoui can block your YouTube videos to bring your site into compliance with the nLPD and the European GDPR.
We have developed a system that will block your YouTube videos until the user's consent has been collected.
Your YouTube videos will be displayed as follows to indicate to visitors that their consent is required:
If the user clicks on "Allow YouTube", consent will be activated for YouTube only. Our blocking system will immediately disappear, allowing the user to play the YouTube video.
How to Activate YouTube Video Blocking with biskoui
A. Add YouTube Service (One-Time Operation)
- Connect to the biskoui console
- Go to the Services menu and click Add a service
- In the list of services, search for YouTube
- Once the service has been selected, select Managed by biskoui (Assisted) and click Add

B. Activate YouTube Video Blocking
Now that the YouTube service has been added, you'll need to modify the integration scripts for your YouTube videos. Here's how to do it:
When you want to embed a YouTube video on your website, YouTube will provide you with an "iframe" embedding script like this one:
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/jNQXAC9IVRw?si=BNdYq_6680jj5-q_"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
To activate video blocking, simply modify the parameter text calling the source src= and replace it with data-src=.
Here's what it will look like in practice:
Before modifying the source parameter:
src="https://www.youtube.com/embed/jNQXAC9IVRw?si=BNdYq_6680jj5-q_"
After modifying the source parameter:
data-src="https://www.youtube.com/embed/jNQXAC9IVRw?si=BNdYq_6680jj5-q_"
Complete example:
<iframe
width="560"
height="315"
data-src="https://www.youtube.com/embed/jNQXAC9IVRw?si=BNdYq_6680jj5-q_"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
This simple manipulation of the source parameter will allow biskoui to execute, or not, the video depending on the status of your visitor's YouTube consent.
You need to do this modification for every YouTube video you embed on your website.
What Happens if the User Withdraws Consent?
The next time the page is loaded, the biskoui blocking system will be reinstated until the user accepts the YouTube service again.
What About YouTube's Advanced Privacy Mode?
When generating the integration script, YouTube will ask you to activate the advanced privacy mode. This is a feature designed to limit the collection of personal data from users. When a video is embedded using this mode, YouTube does not store information about visitors to the page, unless they interact directly with the video by clicking on "Play".
In theory, this means that less data is collected and sent to YouTube than is the case with standard integration, offering greater protection for users' privacy.
However, this advanced privacy mode is being called into question for a number of reasons:
- Limited Protection: Even if the video is not played, certain information, such as the user's IP address, may still be transmitted to YouTube's servers when the page is loaded.
- Lack of Transparency: There is a lack of clarity about the exact nature of the data collected by YouTube and how it is used.
biskoui recommends that you activate the advanced privacy mode while using our blocking system for an additional layer of privacy protection.
Need Help?
Our support team is available at: support@biskoui.ch