Repository navigation
Load YouTube and Lu.ma embeds only after cookie consent - #583
Merged
bilgeyucel merged 1 commit intoOct 5, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@jasdeepbhangal-oss is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bilgeyucel
marked this pull request as ready for review
October 5, 2026 12:05
bilgeyucel
approved these changes
Oct 5, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What loaded before consent
The homepage, the community page and the DeepLearning.AI blog post loaded YouTube iframes and the Lu.ma events calendar iframe as soon as the page opened. Both set third-party cookies before the visitor had chosen anything.
What this changes
consent-embedrenders every YouTube and Lu.ma embed inside an inert<template>, so the browser makes no request. A placeholder with a button ("Load video" or "Load events calendar") fills the same box.assets/js/consent-embeds.js(imported byscript.js) reads the Usercentricsconsent_statusdataLayer event, both entries already pushed and later ones. When the service flag istrue, it swaps in the iframe. Clicking the button loads a single embed.youtube-nocookie.com. Existing query params are kept and lazy loading is kept.youtubeshortcode, used by the blog post that had a raw iframe._buttons.scss.The Usercentrics service names it reads are
YouTube VideoandLu.ma. The Usercentrics loader line inhead.htmlis untouched.How it was tested
Hugo 0.155.2 (the CI version) on localhost, in an isolated Chrome profile with no consent. On the homepage, community page and blog post there were no requests to youtube.com, youtube-nocookie.com, ytimg.com or lu.ma, and placeholders showed at the right size. Pushing
consent_statuswithYouTube Video: trueloaded only the videos. AddingLu.ma: trueloaded the calendar. Click-to-load worked on its own. The real Usercentrics event on page load had both flagsfalse, as expected.I could not check the Usercentrics v3 docs for the
UC_CONSENTwindow event, so it is handled defensively and the dataLayer event is the main signal.🤖 Generated with Claude Code