Repository navigation
fix(consent): load Ketch first and hold Heap and GA4 until consent - #143
Open
dg-coreylweathers wants to merge 1 commit into
Open
dg-coreylweathers wants to merge 1 commit into
dg-coreylweathers wants to merge 1 commit into
Conversation
Vendors developers.deepgram.com's ketch.js (Ketch loader plus the dgOnConsent/dgOnRevoke helpers) as the first script in <head> and its built consent banner, dg-consent.js, unchanged. Heap and GA4 now start only after Ketch grants targeted_advertising, the purpose the Ketch config lists their _hp2_* and _ga cookies under, and stay off when Ketch never loads. The footer gets the Your Privacy Choices control, or a Privacy Policy link when Ketch is unavailable.
This branch has not been 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
cli.deepgram.com and cli.staging.deepgram.com load Heap and GA4 (G-TYPC1TBCKT) before any consent, including for visitors in GDPR regions and when Ketch is blocked, and have no Ketch and no privacy control. This brings the page in line with developers.deepgram.com:
web/src/consent/ketch.js: docs'fern/assets/ketch.js, copied verbatim (the Ketch loader fordeepgram_marketing_siteplus thedgOnConsent/dgOnRevokehelpers), inlined as the first script in<head>.web/public/consent/dg-consent.js: docs' built consent banner, unchanged. It mounts the footer "Your Privacy Choices" control into<div id="fern-footer">(the id the bundle looks for), and shows a Privacy Policy link instead when Ketch is unavailable. Source commit and hashes are inweb/src/consent/SOURCE.json.web/src/consent/trackers.js: Heap (docs' snippet, which also fixes the oldheap[o]=stub bug) and GA4 start only after Ketch grantstargeted_advertising, and stop if it's withdrawn (HeapstopTracking, GAga-disable-<id>, then the banner's reload on withdrawal). Neither starts if Ketch never loads.<html class="dark">makes the banner use its dark theme to match the site. The page has nodark:utilities, so nothing else changes.GA4 purpose:
targeted_advertising. The live Ketch config (production/gdpr/en/config.json) lists_gaand_ga_*, along with Heap's_hp2_*, undertargeted_advertising. Nothing related is listed underanalytics.Checked
Built with
npm ci && npm run build(node:22, Docker), serveddist/, then ran Playwright with a fresh profile each time and Ketch's location stubbed:<head>_gacookiesNotes
web-production.yml), so merging this updates staging only. cli.deepgram.com keeps the ungated trackers until the next release.