Skip to content

consent: the container's cookie banner, served from here, in place of ours - #156

Merged
aledbf merged 1 commit into
mainfrom
aledbf/cookieconsent
Nov 25, 2026
Merged

aledbf merged 1 commit into
mainfrom
aledbf/cookieconsent

Conversation

@aledbf

@aledbf aledbf commented Nov 25, 2026

Copy link
Copy Markdown
Member

The GTM-N6G9KXJ7 container's cookie banner, served from this site instead of jsDelivr, in place of our own. The same change is in the blog, docs and spinbox.dev.

  • Library: vanilla-cookieconsent 3.3.0 (MIT) is copied from npm into public/cookieconsent.* and served from 'self', so the CSP needs no new address.
  • public/consent.js: the same file on all three sites, with the container's settings: cc_cookie on spinbox.dev for 182 days, the texts, equal-weight buttons. Marketing is left out because nothing here shows ads. It does nothing off *.spinbox.dev.
  • Tag Manager now loads on every page with every kind of storage denied. Accepting Analytics grants analytics_storage and pushes cc_consent_update, as the container's banner did. Rejecting it later deletes the _ga cookies.
  • Footer: "Cookie preferences" is an <a data-cc="show-preferencesModal">; the library opens it.
  • Theme: the banner follows the site's theme (cc--darkmode unless data-theme="light").

Tested locally on a copy with the domain check and hideFromBots off, so a headless browser could see it. The banner shows; Accept all pushes the consent update and the event and writes cc_cookie; the footer link opens the preferences.

Still needed in the container: stop the banner's Custom HTML tag from firing on these sites (the CSP blocks it anyway, with an error in the console), and fix doc.spinbox.dev to docs.spinbox.dev in the hostname map.

🤖 Generated with Claude Code

… ours

The banner is vanilla-cookieconsent 3.3.0 (MIT), copied from npm into public/cookieconsent.* and
served from this site, so the CSP needs no other address. public/consent.js, the same file on
spinbox.dev, docs. and blog., carries the settings the GTM-N6G9KXJ7 container's own banner had
(cc_cookie on spinbox.dev for 182 days, the texts, equal-weight buttons) without the marketing
category, since nothing here shows ads. Tag Manager now loads on every page with every kind of
storage denied; accepting Analytics grants analytics_storage and pushes cc_consent_update, as the
container's banner did, and rejecting it later deletes the _ga cookies. Cookie preferences in the
footer is an <a data-cc="show-preferencesModal"> the library opens. Off *.spinbox.dev it does
nothing.

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

Copy link
Copy Markdown

@aledbf
aledbf merged commit 269ddc8 into main Nov 25, 2026
1 check passed
@aledbf
aledbf deleted the aledbf/cookieconsent branch November 25, 2026 20:14
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.

1 participant