feat(analytics): link browser acquisition to product usage - #532
Rinat S (rsolmano) wants to merge 1 commit into
Conversation
🌐 Website preview
This comment updates in place on every push that touches the website or shared build inputs. |
| const outgoing: OutgoingEvent = { | ||
| name: event.name, | ||
| params: { ...s.env, ...("params" in event ? event.params : {}) }, | ||
| params: { ...s.env, ...campaign, ...("params" in event ? event.params : {}) }, |
There was a problem hiding this comment.
Blocking:
Problem: Campaign fields are added to basic events on the permanent basic sink, while revocation only retires the additional sink. Queued or retried basic requests therefore retain consent-scoped attribution after sharing is disabled, violating the analytics revocation contract.
Failure scenario: A campaign-linked message event is queued or receives a retryable failure, the user turns additional sharing off, and the basic sink later sends or retries that event with first/last-touch campaign fields even though consent has been revoked.
Suggested fix: Route campaign-enriched basic deliveries through a consent-generation-owned sink (or rotate/gate the enriched basic queue on revocation) while keeping future non-enriched basics on an active basic sink.
Problem
The website can now create and bind claims, but packaged ThinkRail hosts cannot open, redeem, persist, or apply them to product usage. Marketing context therefore stops at the download.
Approach
Mirror the closed claim schema inside the server analytics boundary and run one verifier-backed, readiness-controlled system-browser flow per packaged installation. Persist only normalized campaign context, keep the one-time journey/bridge IDs on
acquisition_linked, and gate all later campaign enrichment with the existing additional-analytics preference.Changes
acquisition_linkedonce; enrich later basic/additional events with first/last campaign fields while sharing remains on.--no-opennever consumes an attempt.Screenshots
Not applicable — no layout or control changes; the only visible change is compact explanatory text in the existing Privacy section.
Testing
bun run e2e— 413/414 passed; one unrelatedsession.disposecleanup timeout.bun run e2e -- --last-failedrerun passed the failed test.bun run test— 15/15 package tasks passed.Checklist
bun run lint,bun run typecheck,bun run test— lint/test and affected typechecks pass; root typecheck is blocked by the existing Electrobun dev lockbun run e2e, orbun run e2e:fullwhen touching agent behavior)SPEC.md/ top-level specs updated to reflect any boundary, contract, or behavior change