How to implement Embed Consent.
-
Customize the Embed Consent script.
-
Place the code right after
<body>. -
Adjust each embed based on the tag it uses.
<iframe>: Modify thesrcparameter to bedata-src<script>: Modify thetype="text/javascript"parameter to betype="text/plain"
-
Wrap the embed in a container:
<div class="embed-consent-wrapper"></div>.
Example of YouTube embed (<iframe>)
<div class="embed-consent-wrapper"> <iframe width="471" height="315" data-src="https://www.youtube.com/embed/2lAe1cqCOXo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="border:0;"></iframe> </div>
Example of X (Twitter) embed (<script>)
<div class="embed-consent-wrapper"> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">will follow anyone who makes us laugh</p>— Twitter (@Twitter) <a href="https://twitter.com/Twitter/status/1557766422125740032?ref_src=twsrc%5Etfw">August 11, 2022</a></blockquote> <script src="https://platform.twitter.com/widgets.js" charset="utf-8" type="text/plain"></script> </div>
Supported third parties.
Embed Consent detects these embeds automatically when the embed code follows the steps above.