How to remove Google’s tracking cookie from your embedded YouTube videos

Learn how to remove YouTube’s tracking cookie for embedded videos to make your site faster and increase the privacy of your visitors.

YouTube icon and logo with cookies graphic in the bottom corner

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 quicker to load.

Also see: How to block YouTube from tracking your activity and watch videos anonymously

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 that uses no data-collecting HTTP cookies.

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

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, and start playing a video you’d like to embed in your own posts.
  2. Click the Share button underneath the video.
  3. Select the Embed option in the share popup.
  4. Scroll down and tick the box for “Enable privacy-enhanced mode.” Doing so will change the URL embed to use the youtube-nocookie.com format.
  5. Now, copy the code for use.
Enable privacy-enhanced mode for YouTube when getting embed video link

“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.

“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.

You can verify that YouTube’s privacy-enhanced mode is working by using Safari’s Privacy Report feature, which displays a list of known trackers that have been blocked from tracking you when you visit a website. The number of trackers flagged in Safari should decrease by one when you use the youtube-nocookie.com link.

More on YouTube: