Blocking embedded media
If your site embeds external media, such as a YouTube video, you might need to prevent the media from loading until consent has been given for any cookies the media sets.
As with all external resources that your site includes, you should check with the service that provides it to determine what, if any, cookie consent is required to present it to your users.
Example: Blocking an embedded YouTube video
Assume that you have embed code like this from YouTube:
You can make its activation conditional on consent to a particular category, in this example the marketing
category, by using the following pattern, and replacing the embed code where indicated:
More advanced integration is possible using this pattern as a foundation, for example including a still image from an embedded video, or adding a placeholder message.
In the future, we hope to introduce a more automated and streamlined way to control embedded third-party content.
Last updated