Gate Surface tag tracking on form-scoped cookie consent - #75
Draft
0xgautam wants to merge 1 commit into
Draft
Conversation
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.
The Surface tag currently reads visitor storage and starts environment-only journey tracking before knowing the form's cookie policy. This change resolves each registered form's privacy settings first and gates host cookie capture, recognition, journeys and parent conversions, while preserving operational HTML-form submission when tracking is denied.
Implements the scripts handoff for https://github.com/trysurface/surface_forms/pull/5811, pinned to
7d525ac12caf9f8a8475551e907929d46dbc4dc0. The Forms PR is still a draft; this tag requires a compatible API/renderer deployment.Changes
Validation
pnpm typecheckpassed.pnpm testpassed: 48 tests in 11 files, including 216 expected policy outcomes executed from the pinned Forms source, actual SDK bridge interoperability and a bundled-IIFE smoke test.pnpm test:unitpassed: 6 journey tests. The previous node journey cases were migrated into Vitest so CI runs them.pnpm build,git diff --check, andcmp surface_tag.js surface_embed_v1.jspassed.Draft / release gates
Automated tests use mocked network and jsdom; Forms/Paddle staging browser and saved-response QA remains pending. No production forms, CMP settings or submissions were changed.
Before release, follow
docs/cookie-consent.md: verify the consent matrix, withdrawal races, saved metadata, booking/routing/CRM flows and capability recovery against the actual Forms deployment. Site-id-only pages intentionally have no optional host tracking; mixed SDK/tag instances lack a shared Forms policy registry. Direct iframe URLs must start clean, and in-frame self-navigation needs a new registration/authenticated form-ID handshake. Previously queued Dreamdata jobs and already-sent events cannot be recalled by the host tag alone. Separate legacy/standalone tracking assets remain outside this bundle.