Add GAM cohort attribution for Trusted Server traffic - #1028
Open
aram356 wants to merge 17 commits into
Open
Conversation
7 tasks
7 tasks
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.
Summary
gam_attribution_enabledGPT option that applies fixed page-levelts=truetargeting to eligible publisher documents whose rewritten head is emitted by Trusted Server, allowing GAM to describe treatment delivery while the production/control path remains unmarked.document.currentScriptattribute-gated TSJS fallback that fails closed and isolatessetConfigfailures.ts_initiallifecycle, and publisher/Prebid targeting while documenting the collision audit, reporting contract, rollout, monitoring limits, and drain-safe rollback sequence.Changes
crates/trusted-server-cli/tests/config_env_overlay.rscrates/trusted-server-core/src/creative_opportunities.rststargeting remains forwarded unchanged.crates/trusted-server-core/src/html_processor.rscrates/trusted-server-core/src/integrations/gpt.rscrates/trusted-server-core/src/integrations/gpt_bootstrap.jsts=truebefore the existingadInitguard and isolate attribution failures from later GPT commands.crates/trusted-server-core/src/integrations/registry.rscrates/trusted-server-core/src/publisher.rscrates/trusted-server-core/src/tsjs.rscrates/trusted-server-integration-tests/browser/tests/shared/script-injection.spec.tscrates/trusted-server-integration-tests/fixtures/configs/trusted-server.integration.tomlcrates/trusted-server-js/lib/src/integrations/gpt/index.tscrates/trusted-server-js/lib/test/integrations/gpt/ad_init.test.tstskey.crates/trusted-server-js/lib/test/integrations/gpt/gpt_bootstrap.test.tssetConfig, and bootstrap continuity.crates/trusted-server-js/lib/test/integrations/gpt/index.test.tscrates/trusted-server-js/lib/test/integrations/prebid/index.test.tststargeting across refreshes.docs/guide/integrations/gpt.mddocs/superpowers/plans/2026-07-15-gam-ts-cohort-attribution.mddocs/superpowers/specs/2026-07-15-gam-ts-cohort-attribution-design.mdtrusted-server.example.tomlLaunch gates
This PR completes the repository implementation. Starting the cohort remains gated on target-network GAM provisioning, cross-system collision and privacy/CSP audits, a paired-report dry run, and router-controlled treatment validation described in the design.
GAM results are descriptive delivery attribution, not causal treatment-effect estimates.
Closes
Closes #1027
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest run(44 files, 847 tests)cd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serve: confirmed the inline flag, activation attribute, GPT page targeting, and decodedcust_paramscontainingts=trueon a real GAM requestChecklist
unwrap()added to production code