On this page
What this issue is
A third-party embed is a piece of another company's content shown inside your page, usually through an iframe. Common ones are YouTube videos, Google Maps, Vimeo, Calendly, social feeds and chat widgets.
When the page loads, the visitor's browser connects to the embed provider straight away. The provider can set cookies or read identifiers, and it sees the visitor's IP address. Under the ePrivacy rules (which apply in the EU and, through UK PECR, in the UK), storing or reading non-essential cookies needs prior consent. If this happens before the visitor clicks anything in your cookie banner, you have a consent problem.
Why it costs you leads or sales
The direct cost is risk: regulators and complainants can point to cookies set without consent, and the fix is easy to demand. The indirect costs matter for marketing teams too.
- Your banner says no cookies until consent, but the page behaves differently. That breaks trust and can undermine consent records.
- Visitors who reject cookies still get tracked by the embed, so your cookie list and privacy policy are inaccurate.
- A fix done in a rush (blocking the whole page script) can break the video or map, or the lead form next to it.
- Embeds add third-party requests that slow the page, which can lower conversions on landing pages.
- Visitor opens pagePage HTML loads with an iframe in it
- Embed loadsBrowser contacts youtube.com or google.com
- Cookie setProvider stores or reads identifiers
- Banner choiceVisitor rejects, but it is too late
The embed loads on page load, so the cookie is set before the banner choice is made.
How to check if your site has it
Test as a first-time visitor who has not accepted anything. Use a private window so old cookies do not hide the problem.
Open a private window
Visit a page with a YouTube video or map. Do not click anything in the cookie banner.
Open DevTools
Press F12, then go to Application > Cookies. Look at entries for youtube.com, google.com, doubleclick.net or the embed provider.
Check the Network tab
Reload with the Network tab open and filter by the provider name. Requests that appear before you interact with the banner show the embed loading without consent.
Repeat after rejecting
Clear cookies, reload, click Reject all, and look again. Cookies or requests that still appear are not honouring the choice.
Search your code for embeds
Look in templates and page content for
<iframe,youtube.com/embed,google.com/maps/embedand any embed plugins.
How to fix it
There are two reliable approaches. Pick one per embed.
| Approach | How it works | Best for |
|---|---|---|
| Block until consent | Your consent tool keeps the iframe from loading until the visitor accepts the matching category | Sites with a working consent platform |
| Click-to-load placeholder | A static image and a button replace the embed; the iframe loads only on click | Any site, and it also speeds up the page |
| youtube-nocookie.com | YouTube's privacy-enhanced mode delays some cookies until playback | Extra layer only, not a full fix on its own |
| Replace with a link or static image | Link to the video or show a static map image | Pages where the embed is not essential |
Use your consent plugin's blocking
Most consent plugins (for example Complianz, CookieYes, Cookiebot) have a setting to block iframes until consent and show a placeholder. Turn on the YouTube and Google Maps services in the plugin.
Check page builders and embed blocks
Elementor, Divi and the block editor YouTube embed can load iframes outside the plugin's reach. Re-test in a private window after changing settings.
Switch to privacy-enhanced mode
In the YouTube embed URL, change youtube.com to youtube-nocookie.com as an extra layer.
Find the embed
Look in Online Store > Themes > Edit code for iframe tags, and in Customize for video and map sections.
Use your consent app's iframe blocking
If your consent app supports blocking third-party content, enable it for YouTube and Maps. Otherwise use the click-to-load code below in the section file.
Test the theme's video sections
Some themes load the YouTube player script on page load even for lazy video sections. Check Network requests after changes.
Understand the limit
GTM can only control tags it fires. An iframe hard-coded in the page loads regardless of GTM.
Inject embeds through a consent-gated tag
Create a Custom HTML tag that adds the iframe, and set it to fire only when the relevant consent type (for example the marketing or functional category in your setup) is granted.
Remove the hard-coded iframe
Replace it with an empty container element that the tag fills after consent.
Replace the native embed element
Webflow's Video and Map elements load providers on page load. Swap them for a Custom Embed holding the click-to-load code below.
Use your consent tool
If your consent platform provides a Webflow script, set the iframe to be blocked by category and add the required data attributes as its docs describe.
Find video and map elements
In the funnel or website builder, look for Video elements and Custom Code or HTML elements containing iframes.
Swap in a click-to-load block
Use a Custom HTML/JS element with the click-to-load snippet instead of a direct iframe.
Use Wix cookie consent settings
In Settings > Cookie Consent Banner, check which categories apply, and in Privacy & Cookies review how Wix handles its video and map apps.
Replace risky embeds
For HTML iframe embeds you added yourself, replace them with a link or an image button that opens the video or map in a new tab.
Review the Cookie Banner
In Settings > Cookies & Visitor Data, check how the banner treats video and map blocks, since behaviour depends on your template version.
Replace with a link where needed
If you cannot confirm that a block waits for consent, use a Code Block with the click-to-load snippet or an image button linking out.
Remove the iframe src from the HTML
Store the URL in a data attribute so the browser does not fetch it on load.
Load on click or on consent
Set the src from JavaScript only after the visitor clicks, or after your consent tool reports the right category as granted.
<div class="yt-consent" data-src="https://www.youtube-nocookie.com/embed/VIDEO_ID?autoplay=1">
<p>This video is hosted by YouTube. Loading it may set cookies.</p>
<button type="button">Load video</button>
</div>
<script>
document.querySelectorAll('.yt-consent button').forEach(function (btn) {
btn.addEventListener('click', function () {
var box = btn.closest('.yt-consent');
var frame = document.createElement('iframe');
frame.src = box.dataset.src;
frame.width = '560';
frame.height = '315';
frame.allow = 'autoplay; encrypted-media; picture-in-picture';
frame.allowFullscreen = true;
box.replaceChildren(frame);
});
});
</script>Before
- Iframe loads on page load
- Cookies appear before any banner choice
- Rejecting cookies changes nothing for the embed
After
- Placeholder shown until click or consent
- No requests to the provider before the choice
- Rejecting keeps the embed blocked
How to confirm it's fixed
Test a clean first visit
In a new private window, open the page and do not touch the banner. In DevTools, there should be no cookies and no network requests to youtube.com, google.com/maps or the provider.
Test Reject all
Click Reject all and reload. The embed should still show the placeholder.
Test Accept
Accept the matching category. The embed should now load and play or show the map.
Test on mobile
Repeat on a phone, as some themes load different embeds on small screens.
How to prevent it happening again
- Keep a list of every embed on the site and the consent category each one belongs to.
- Add a click-to-load pattern to your theme or page templates, so editors do not paste raw iframes.
- Tell editors not to paste embed codes from YouTube or Maps directly into pages.
- Re-test in a private window after theme, plugin or consent tool updates.
- Review your cookie policy when you add a new embed type.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. Its robot visitor can run a consent-denied variant of your journey, and in that variant it checks whether tracking hits are still sent to ad and analytics platforms (GA4, Google Ads, Meta, TikTok, LinkedIn, Bing, Pinterest, Snapchat, X, Reddit). If hits appear after consent is denied, you get an alert with a screenshot and a likely cause.
What it does not do: it does not list the cookies that YouTube, Google Maps or other embeds set, and it does not tell you whether an iframe loaded before the banner choice. A clean consent-denied run therefore does not prove your embeds are compliant.
Run the private-window check
Follow the DevTools steps above on every page type that holds an embed, before and after rejecting.
Re-check after changes
Repeat after theme, plugin, page builder or consent tool updates, and when editors add new pages.
Record the result
Note the date, pages tested and what you found, so you can show the checks were done.
The Free plan (1 site, 2 journeys, daily checks, no card) is enough to try the consent-denied check. A free read-only website audit is also available.
Questions people ask
Does a YouTube embed set cookies before consent?
It can. A standard YouTube iframe connects to Google servers when the page loads and may set cookies or read identifiers, before the visitor has agreed. Test it in a private window and look in DevTools under Application > Cookies.
Is youtube-nocookie.com GDPR compliant?
Not automatically. Privacy-enhanced mode limits some cookies until the video is played, but the browser still contacts Google when the page loads. Use it as an extra layer alongside consent blocking or a click-to-load placeholder.
Does Google Maps need cookie consent?
A standard Google Maps embed loads Google resources and can set cookies, so many sites treat it as needing consent. Block it until the visitor agrees, or show a static image with a link to the map. Ask your legal adviser how to categorise it.
How do I block an iframe until cookie consent is given?
Keep the iframe URL out of the src attribute until consent. Your consent tool can do this by category, or you can use a placeholder with a button that sets the src on click. Then confirm in DevTools that nothing loads before the choice.
How do I check which cookies my embeds set?
Open the page in a private window without touching the banner. Press F12 and open Application > Cookies, then look at the Network tab for requests to the embed provider. Repeat after clicking Reject all.
Can Google Tag Manager block my YouTube embed?
Only if GTM inserts the embed. An iframe written directly into the page loads regardless of GTM. Remove it and have a consent-gated Custom HTML tag add it after consent.
Does FunnelGuard detect embeds setting cookies before consent?
Only partly. It runs a consent-denied variant and flags tracking hits that still fire to ad and analytics platforms. It does not list cookies set by embeds such as YouTube or Maps, so you need to check those by hand.
Related issues
- OPS-320Tracking fires before consentFix guide
- OPS-324Consent not honoured after reject (pixels still fire)Fix guide
- OPS-319No cookie banner for EU/UK visitorsFix guide
- OPS-326Cookie policy missing or outdated cookie listFix guide
- OPS-340Google Fonts loaded from Google (German GDPR rulings)Fix guide
- OPS-323Consent Mode v2 not implementedFix guide