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.
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.
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.
- Open youtube.com in your favorite desktop web browser, like Safari.
- Start playing a video you’d like to embed in your own posts.
- Choose the option labeled “Share” underneath the video.
- Hit “Embed” in the Share popup.
- 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.
“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.
- Load up the original webpage with the video embedded the usual way.
- Choose “Privacy Report”from the Safari menu.
- Memorize the number of trackers flagged.
- Now replace the embedded video with its non-tracking variant.
- Choose “Privacy Report” again.
The number of trackers flagged in Safari should decrease by one.