# YouTube-video's insluiten met verbeterde privacy-modus (youtube-nocookie.com)

**URL:** https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469
**Category:** Feature
**Created:** [30 januari 2022 om 06:20 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469 "2022-01-30T06:20:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [30 januari 2022 om 06:20 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/1 "2022-01-30T06:20:45Z")

</div>

At the moment Discourse embed YouTube videos with the standard URL. However, [Grav](https://getgrav.org/) rewrites URLs automatically so that it uses the [YouTube privacy enhanced mode](https://www.guidingtech.com/privacy-enhanced-youtube/). Which doesn’t store tracking cookies when people do not play the video. This feature makes cookie/privacy policies a bit easier to write. Is this something Discourse can introduce as well?

Below is a snippet of what Grav automatically generates when inserting a YouTube video into a page. More info about this Grav plugin [here](https://github.com/getgrav/grav-plugin-youtube).

```plaintext
<div class="grav-youtube-wrapper ">
  <div class="grav-youtube">
      <iframe src="https://www.youtube-nocookie.com/embed/th5KmL-tTI0?cc_load_policy=1&amp;color=white&amp;modestbranding=1&amp;rel=0" frameborder="0" allowfullscreen></iframe>
  </div>
</div>

```

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [15 maart 2022 om 17:14 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/2 "2022-03-15T17:14:25Z")

</div>

This is still an issue with European data protection agencies focusing on everything Google.

Would it be an idea to just change the Youtube oneboxing code to _always_ use `youtube-nocookie.com` instead of `youtube.com` ?

Would you be accepting a PR for this? @codinghorror @sam ?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [15 maart 2022 om 17:23 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/4 "2022-03-15T17:23:19Z")

</div>

We have considered this in the past, but it will have a negative impact on the UX. [youtube-nocookie.com](http://youtube-nocookie.com) doesn’t link viewing activity to your YouTube account, so things like viewing history, recommendations, etc. will stop working.

Note that our YouTube onebox implementation only loads youtube iframe after the user clicks on the thumbnail, so cookies will not be set unless the user interacts with the embed.

That said, adding support for [youtube-nocookie.com](http://youtube-nocookie.com) behind a site setting (or maybe… via a theme component - I think it should be possible 🤔) would likely be welcome.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [15 maart 2022 om 18:30 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/6 "2022-03-15T18:30:30Z")

</div>

A PR is always welcome! Especially if it is a setting. Thank you! 🤗

---

<div class="post-metadata">

### Author: ![Crius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crius/32/317214_2.png) [@Crius](https://meta.discourse.org/u/Crius)
#### Post date: [31 maart 2023 om 11:28 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/7 "2023-03-31T11:28:34Z")

</div>

Sorry for reviving this. Has anything been done by someone on this feature?

> [youtube-nocookie.com](http://youtube-nocookie.com/) doesn’t link viewing activity to your YouTube account, so things like viewing history, recommendations, etc. will stop working.

This is absolutely a much more desired outcome considering that on a forum you may end up watching a video linked by someone else just because you are curious and ends up with good old Youtube inundating your feed with videos of that topic.

If nothing has been done, can someone give some pointers at what should this be? A plugin ( changing how the embed if cooked into the db) or a theme component (would it even work?)

---

<div class="post-metadata">

### Author: ![V1ktor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/v1ktor/32/232406_2.png) [@V1ktor](https://meta.discourse.org/u/V1ktor)
#### Post date: [3 augustus 2023 om 19:27 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/8 "2023-08-03T19:27:36Z")

</div>

+1 on this.

---

<div class="post-metadata">

### Author: ![Convl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/convl/32/522886_2.png) [@Convl](https://meta.discourse.org/u/Convl)
#### Post date: [25 september 2025 om 11:18 UTC](https://meta.discourse.org/t/embed-youtube-videos-with-enhanced-privacy-mode-youtube-nocookie-com/216469/9 "2025-09-25T11:18:29Z")

</div>

This has become more critical of late, as Google has introduced some change in their embedding logic which now causes youtube embeds to throw a 153 error when users are logged in to their Google accounts, forcing them to click on the embed to open the video in a new tab, cf. e.g. this Reddit post: [Reddit - Please wait for verification](https://www.reddit.com/r/Anytype/comments/1n6tuvn/comment/ndg78u0/)

This is issue can be fixed by converting the link in the iframe from [youtube.com](http://youtube.com) to [youtube-nocookie.com](http://youtube-nocookie.com) . Whatever UX disadvantage comes from not having the video contribute to your view history is surely outweighed by being able to actually view it as an embed, so the option to convert embed links accordingly would be much appreciated.
