Skip to main content
All guides
Moderate KVKK m.5 · GDPR Art. 6 · ePrivacy Art. 5(3) · Chapter V · Video embed

Stop YouTube embeds tracking visitors before consent (KVKK/GDPR)

A standard YouTube <iframe> contacts Google and can set advertising cookies as soon as the page loads — before the visitor ever presses play or accepts cookies.

Why it matters

An embedded player is a third-party (Google/DoubleClick) request that runs on page load, so it can drop tracking cookies pre-consent (ePrivacy Art. 5(3) / GDPR Art. 6) and transfer data to Google in the US (Chapter V). The video is not essential to the page, so it should not load third-party trackers before a choice is made.

How to fix it

Use the youtube-nocookie.com privacy-enhanced domain to reduce cookie-dropping, and — better still — use a facade: show a static thumbnail and only load the real iframe when the visitor clicks play (or after consent). That way no request reaches Google until the visitor asks for the video.

<!-- Facade: no request to Google until the user clicks play -->
<div class="yt-facade" data-id="VIDEO_ID">
  <img src="/img/video-poster.jpg" alt="Play video">
  <button type="button">▶ Play</button>
</div>
<script>
document.querySelector('.yt-facade button').addEventListener('click', (e) => {
  const w = e.target.closest('.yt-facade');
  w.innerHTML = '<iframe width="560" height="315" allow="autoplay" ' +
    'src="https://www.youtube-nocookie.com/embed/' + w.dataset.id + '?autoplay=1"></iframe>';
});
</script>

Does your site have this issue?

Run a free scan to find out in seconds.

Official sources

Links to primary legislation for reference. PrivaScan is not affiliated with these bodies; this is information, not legal advice.

Related guides

These guides cover automated checks for trackers, cookies and data flows. A full privacy review also needs legal input.