Skip to content

Load YouTube and Lu.ma embeds only after cookie consent - #583

Merged
bilgeyucel merged 1 commit into
deepset-ai:mainfrom
jasdeepbhangal-oss:consent-gate-embeds
Oct 5, 2026
Merged

bilgeyucel merged 1 commit into
deepset-ai:mainfrom
jasdeepbhangal-oss:consent-gate-embeds

Conversation

@jasdeepbhangal-oss

Copy link
Copy Markdown
Contributor

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

  • New partial consent-embed renders 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.
  • New assets/js/consent-embeds.js (imported by script.js) reads the Usercentrics consent_status dataLayer event, both entries already pushed and later ones. When the service flag is true, it swaps in the iframe. Clicking the button loads a single embed.
  • YouTube now loads from youtube-nocookie.com. Existing query params are kept and lazy loading is kept.
  • New youtube shortcode, used by the blog post that had a raw iframe.
  • Placeholder styles added to _buttons.scss.

The Usercentrics service names it reads are YouTube Video and Lu.ma. The Usercentrics loader line in head.html is 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_status with YouTube Video: true loaded only the videos. Adding Lu.ma: true loaded the calendar. Click-to-load worked on its own. The real Usercentrics event on page load had both flags false, as expected.

I could not check the Usercentrics v3 docs for the UC_CONSENT window event, so it is handled defensively and the dataLayer event is the main signal.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

@jasdeepbhangal-oss is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
haystack-home Ready Ready Preview Oct 5, 2026 11:52am UTC

Request Review

@bilgeyucel
bilgeyucel marked this pull request as ready for review October 5, 2026 12:05
@bilgeyucel
bilgeyucel requested a review from a team as a code owner October 5, 2026 12:05
@bilgeyucel
bilgeyucel merged commit 8fb9d3f into deepset-ai:main Oct 5, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — d859b744 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants