Repository navigation
Load HubSpot and Reo on demos.handsontable.com behind Cookiebot consent - #476
Merged
Merged
Conversation
Links from DevRel posts land on demos.handsontable.com, but the runner loaded no marketing tag, so a visit from a campaign link left no pageview, campaign attribution or account match in HubSpot or Reo. The authoring SPA now loads the Cookiebot banner (the account handsontable.com uses) and, only once marketing consent is recorded, the HubSpot tracking code and the Reo tag. The decision lives in the import-free marketingGate.ts: production host only, never under webdriver, never for a signed-in staff session. /d, /embed and Tier-2 previews are user code and never carry the tags. ADR-0044 records the decision; AGENTS.md scopes the "no cookies" rule to the runner's own telemetry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
demtario
reviewed
Oct 29, 2026
Unticking only marketing in the Cookiebot banner fires CookiebotOnAccept, not CookiebotOnDecline, so the loader never revoked anything, and on a full decline only HubSpot was told while Reo kept running. Every Cookiebot event now re-reads the consent and compares it with what is loaded (consentAction, tested). A withdrawal clears both tags' cookies, tells HubSpot, and reloads the page without the scripts: Reo has no stop call. Only signed-out pages carry the tags, and their edits are never persisted, so the reload loses nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
demtario
approved these changes
Oct 29, 2026
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.
Context
DevRel posts link to demos.handsontable.com, but the runner loads no marketing tag. A visitor who arrives from a
utm_campaignlink leaves no pageview, no campaign attribution and no account match in HubSpot or Reo, so the campaign can't be connected to pipeline.The authoring SPA now loads the Cookiebot banner, using the account handsontable.com uses. Once marketing consent is recorded, it loads the HubSpot tracking code and the Reo tag.
/,/share/:id, the guide and the editor only./d,/embedand Tier-2 previews are user code and never carry the tags.marketingGate.ts, tested inpipeline/marketing-gate.test.mjs. The DOM side ismarketingTags.ts, started frommain.tsxundersafeInit.Errors thrown by the third-party scripts are already dropped by Sentry's cross-origin gate (
isForeignUnhandled), soeventGate.tsis unchanged.Before or after merge (admin, outside the repo):
demos.handsontable.comto the Cookiebot domain group. Until then the banner reports an unauthorised domain, no consent is recorded, and the tags stay off. It fails closed.Types of changes
runner/) changeHow was this verified?
Locally:
pnpm test(2765 pass),pnpm build,pnpm typecheck, the authoring build,check-compiler-chunk,check:telemetry-leak,check-test-presence.Ran the production build in Chromium under the
demos.handsontable.comhostname, with Cookiebot stubbed and third-party requests recorded:/,/share/abc)js-eu1.hs-scripts.com,static.reo.devnavigator.webdrivertrueAfter deploy, still to check: a clean browser through a
/share/<id>?utm_campaign=DevRellink, with accept and with decline; a signed-in tab; a docs page with an/embediframe.Checklist
runner/config/frameworks.json(see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.compnpm build(andpnpm dev) in the affected example/server-example locallyRelated issue(s):
🤖 Generated with Claude Code
Note
Medium Risk
Introduces third-party marketing scripts and cross-subdomain cookies on production for signed-out visitors; mitigated by consent gating, narrow surface, and automated gate tests, but requires correct Cookiebot domain configuration to fail closed.
Overview
Adds ADR-0044 and wires the authoring SPA to load Cookiebot, then HubSpot and Reo only after
Cookiebot.consent.marketingis true—so DevRel traffic ondemos.handsontable.comcan be attributed without touching the runner’s anonymous telemetry.Scope: Tags run only on SPA routes (
/,/share/:id, guide, editor) viainitMarketingTagsinmain.tsx(samesafeInitpattern as telemetry)./d,/embed, and Tier-2 previews stay tag-free.marketingGate.tsmirrorsreportingGate: strict production hostname, nonavigator.webdriver, no staff session (sync token /#token=). Consent changes useconsentActionso revoking marketing (including viaCookiebotOnAcceptwhen only marketing is unticked) clears cookies, notifies HubSpot, and reloads.pipeline/marketing-gate.test.mjslocks the gate; AGENTS.md notes marketing as the exception to the “no cookies” rule for runner telemetry.Reviewed by Cursor Bugbot for commit 4a97564. Bugbot is set up for automated code reviews on this repo. Configure here.