If you embed YouTube videos in your own blog posts, you may want to remove Google’s invasive tracking to both protect the privacy of your visitors and make your site faster. In this tutorial, we’ll teach you how to embed YouTube videos in a privacy-enhanced way.

Why does YouTube set a tracking cookie?

Google sets a tracking cookie for YouTube videos for marketing and advertising purposes. Because YouTube tracking violates the European Union’s strict GDPR laws, Google was forced to offer a GDPR-compliant alternative which uses no data-collecting HTTP cookies.

Although Apple’s Safari browser is blocking ad trackers by default, YouTube tracking cannot be avoided if you embed videos as you normally would, by linking to them on youtube.com. With a simple change, however, you can get rid of YouTube’s data-collecting HTTP cookie in embeds.

An image displaying a YouTube logo set against a black background to illustrate the tutorial about how to remove YouTube tracking cookie

Follow along with us as we show you how to remove YouTube tracking.

How to remove YouTube tracking

With a few clicks, you can copy a privacy-enhanced embed code that basically links to a privacy-enhanced YouTube URL which ensures no data-collecting cookie is sent.

  1. Open youtube.com in your favorite desktop web browser, like Safari.
  2. Start playing a video you’d like to embed in your own posts.
  3. Choose the option labeled “Share” underneath the video.
  4. Hit “Embed” in the Share popup.
  5. Scroll down and tick the box next to “Enable privacy-enhanced mode.”

Doing so will change the URL-embed to use the youtube-nocookie.com format.

“Privacy Enhanced Mode allows you to embed YouTube videos without using cookies that track viewing behavior,” according to a support document on the Google website. “This means no activity is collected to personalize the viewing experience.”

If you’re not using YouTube’s own embed codes in your own posts, you can also do this manually by changing the domain for the embed URL in your HTML code from https://www.youtube.com to https://www.youtube-nocookie.com, as we noted earlier.

How to loop YouTube videos

“Since this is a different domain, network administrators also need to add the domain youtube-nocookie.com to their firewall whitelist in addition to youtube.com,” Google cautions. Videos embedded in this mode will not influence the viewer’s browsing experience on YouTube. Also, this mode is only available for embedded players on websites.

How to verify if YouTube’s privacy-enhanced mode works

You can verify that this is working by using Safari’s Privacy Report feature that displays a list of known trackers that have been blocked from tracking you when you visit a website.

  1. Load up the original webpage with the video embedded the usual way.
  2. Choose “Privacy Report”from the Safari menu.
  3. Memorize the number of trackers flagged.
  4. Now replace the embedded video with its non-tracking variant.
  5. Choose “Privacy Report” again.

The number of trackers flagged in Safari should decrease by one.