YouTube iframe not being auto-blocked - how to fix

Modified on Thu, 6 Aug at 1:48 PM

If you have a YouTube video embed that is loading in prior to consent, here are some options to potentially resolve the issue:


1. Make sure you have "YouTube Video" listed as a pre-defined Service within your Termageddon license.


In your Termageddon dashboard, click into your license, click 'edit' for Cookie Policy and Consent Tool, and scroll to the very bottom to the Services section. If you do not see Youtube Video listed, click "+Add Service" -> Predefined -> "YouTube Video" and add the Service. Click "Save and Exit".


Now visit your website in a fresh incognito window. In the consent banner, click 'more information' and under Functional you should see "YouTube Video" now listed.


2. Update the iframe from 'src' to 'uc-src':

If your YouTube embed code looks like this:


<iframe width="560" height="315" src="https://www.youtube.com/embed/XXXXXXXXX?si=XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>


Try updating the embed code to this:


<iframe width="560" height="315" uc-src="https://www.youtube.com/embed/XXXXXXXXX?si=XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>


All you change is 'src' to 'uc-src'.


Test changes by visiting your website in a fresh incognito window. 


Additional items to consider:


Are you loading in videos via a theme feature, plugin, or module?

Very often, we see website owners loading in videos via a third party tool (theme, plugin, module) which modifies the default design and functionality of a standard YouTube embed.


This can cause issues with consnet solutions, especially when this third party feature is not built to support consent. 


If you have a WordPress website, visit Tools -> Termageddon + Usercentrics -> Integrations, as we may offer support for some common video player plugins / theme features.  


You can also contact support - please provide a URL to the page where we can see the embedded video to perform testing.


Load videos locally

With third party scripts now being considered high risk for website owners, now would be a great time to consider converting your video embeds to locally loaded videos/mp4s.  By locally loading your video, you avoid the need to get consent to load in third party tracking technologies, such as YouTube (which collects and shares your website visitor data with Google).   That means your videos will load, even for users that click 'deny'.  This is a privacy best practice too as you're not sharing data with third party trackers such as YouTube/Google. 



Blocker message styling

If you are embedding a YouTube video into a small area of the website, the default blocker message may require users to scroll down within the blocker message to click 'accept' to load in the video.  You can apply css to make the description text and blocker title message a much smaller font size, helpinig ensure the 'accept' and 'more information' buttons display without requiring users to scroll down. Here's a guide on the CSS you can use to make these modifications. You can reach out to support if you'd like help with creating the CSS to do this for your particular website. 




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article