I was working on a Webflow project where Vimeo videos are embedded via a Webflow CMS Collection List and I’m using Finsweet Cookie Consent to handle cookie preferences.
I ended up solving it with a Custom Code, but I was wondering, if there is a native solution to this.
Is there a native way to handle this through the Cookie Consent app – without having to manually write custom code? Or is this workaround still the only way right now?
Thanks in advance for any insights and best regards,
Riccardo
I am also curious about this! My team uses cms lists + video elements that are being flagged by the cookie-consent script scanner. Is there a way to switch to using the youtube video element + privacy mode so that the scanner doesnt detect those elements? We are not able to use the iframe solution posted in the docs. Thanks in advance for the help.
There is a way to do this, but it may require a rework of the CMS structure—we’d need the YouTube or Vimeo ID stored in a plain text field so it can be dynamically inserted into an Embed element.
Instead of using the native Video element, we use a custom HTML Embed and let Finsweet Cookie Consent handle the iframe loading upon user consent.
For YouTube:
<!-- This iframe is managed by Finsweet Cookie Consent -->
<iframe
loading="lazy"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
fs-consent-categories="essential"
fs-consent-src="https://www.youtube-nocookie.com/embed/YOUTUBE_ID"
></iframe>
For Vimeo:
<!-- This iframe is managed by Finsweet Cookie Consent -->
<iframe
loading="lazy"
frameborder="0"
allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen
fs-consent-categories="essential"
fs-consent-src="https://player.vimeo.com/video/VIMEO_ID?autoplay=1"
></iframe>
Note: These iframes will only be loaded if the user has accepted cookies in the specified category (fs-consent-categories). Right now it’s set to "essential", but you should update it to "marketing" or the appropriate category according to your consent policy.
This ensures the video content won’t load or send any data to YouTube or Vimeo unless the user has given proper consent.