Disabling Youtube Cookies

Hi guys,

we want to offer our visitors the possibility to decline cookie use. However, YouTube for example places cookies automatically if you open a page with an embedded video.

Youtube offers a nocookie-embed options, which can be used like this:
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/J---aiyznGQ?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

However, this comes with several problems:

  1. After clicking on play, the cookies will still be set (which should not happen if consent was declined)
  2. ā€œhttps://www.youtube-nocookie.com/embed/J---aiyznGQā€ does not get accepted as a link url in Webflows video element
  3. It also doesn’t work in Rich Body Elements

I was thinking about writing a script that removes the video, until consent is given. But I guess that would not work since cookies are placed by YT immediately. Can anyone think of a smart solution?

3 Likes

I’m interested in this as well. Both Vimeo and Youtube have ā€˜privacy-problems’ regarding the GDPR. You preferably don’t want to use them if you want 100% compliant (and want to avoid obstructive/annoying cookie-walls).

1 Like

Unfortunately there is no way to enforce this, since editors can always use videos in rich texts.

It would be great if youtube’s privacy urls would be allowed. Then we could implement a custom solution on top, to remove the video if cookies were disabled, and no cookie will ever be set.

So for now, we can only use video’s with custom iframes, if we don’t want YT to set cookies (by default).
Is there an option to host a video on Webflow (besides the background video)?

Any updates on youtube embeds? I think the problem is bigger than just youtube videos – vimeo, google maps etc. Any ideas how to use it on my client’s website and stay GDPR compliant?

1 Like

Might have to create a wishlist item for this?

2 Likes

Hey guys, I created a wishlist item:
https://wishlist.webflow.com/ideas/WEBFLOW-I-1540

However, this is probably difficult to solve for webflow as long as they don’t offer a general cookie handling feature themselves. The only other solution I could think of is to not insert video elements by default and offering a javascript function to insert the video that webflow users can call once cookies are accepted.

1 Like

Hey andre9000
I wouldn’t use any embeds on my personal websites, but what about clients asking to add a youtube video or a google maps embed on their website? It’s a huge limitation. On wordpress there are endless plugins to stay GDPR compliant though. So naturally I will lose my clients to Wordpress developers… Embed Plus Plugin for YouTube, with YouTube Gallery, Channel, Playlist, Live Stream, Facade – WordPress plugin | WordPress.org
There are plenty of plugins to stay GDPR compliant

@Josef @andre9000 do you have found any solutions for this topic?

This could be a useful solution → https://www.bmg.studio/solution/gdpr-compliant-youtube-video-iframe-blocking

So this is not an inhouse webflow solution but since most customizable cookie banner solutions (with automatic cookie recognition) are not free of charge I decided to use Cookiebot (for now).
They also added some custom JS-code to add a placeholder for Youtube videos once the user declines Youtube marketing cookies. The code didn’t work right away but I modified it with ChatGpT until it did. This is the original code:

I really hope webflow will add a cost-free solution. This was actually my expectation: That there would be free of charge additions/plugins to use for the few additional use cases the webflow implementation doesn’t cover. That was my main reason for switching from wordpress to webflow: Fewer plugins I’d have to pay for. Turns out: It’s only true to a certain extent.

So now I have a working placeholder for youtube videos in my rich text elements.

  1. The youtube videos are being added in the CMS backend via an HTML-code in an embed element.
  2. They are being styled via CSS-code by an embed element on the dynamic article-site that contains the rich text elements.
  3. They are being enabled via JS-code that was added to the ā€œFooter codeā€ or ā€œbefore tagā€ within the site-settings. This only works in combination with the cookiebot solution. But I reckon, a modified version should work with similar solutions as well.

If the user clicks on withdraw consent/decline/ etc. the placeholder will be shown. If they accept Youtube marketing cookies or all cookies, the video will be shown. Let me know in case you are interested in the code.