feat(gtm): Spec 1E — qualified lead + drift guard (analytics-foundation 1e)#376
Merged
Merged
Conversation
…uard) Closes analytics-foundation. Two deliverables carved out of Spec 1D: - marketing:lead_qualified server-side, fired from /api/leads when the enterprise gate passes (non-personal email domain + non-empty company). Personal-email blocklist lives in @ngaf/telemetry/shared. - Code → taxonomy drift guard (mirror of the existing insights guard). Regex scanner over apps/ + libs/ asserts every fired event name is documented in docs/gtm/taxonomy.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… lead + drift guard) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
19 free-mail domains in a ReadonlySet plus a case-insensitive predicate. Used by the website's lead-qualification gate to filter out personal email submissions before firing marketing:lead_qualified. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ared Both the website (lead-qualification gate, this PR) and any future consumer can import the blocklist + predicate from the published lib. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Symbolic ref for the new server-side event. Wiring lands in Tasks 1.2 and 1.3. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…e leads
captureLeadQualified gates on getEmailDomain(email) being present,
isPersonalEmailDomain(domain) being false, and toSafeAnalyticsString(company, 200)
being non-empty. When all three pass, fires marketing:lead_qualified with
properties { email_domain, company, source_page, track: 'enterprise' }.
Wired from /api/leads/route.ts immediately after captureLeadConversion.
Five unit tests cover the gate matrix.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
New node:test script that scans apps/ + libs/ for event-name literals
fired via posthog.capture(...), track(...), captureServerEvent({event}),
or analyticsEvents.<key>. Asserts every name is documented in
docs/gtm/taxonomy.md. Mirror of the existing insights → taxonomy guard.
Catches the kind of drift that slipped through during Spec 1C
(cockpit:recipe_start → recipe_opened rename).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Spec 1E closes analytics-foundation. Two deliverables carved out of Spec 1D:
The qualification rules and the personal-email blocklist (19 free-mail domains) live in `@ngaf/telemetry/shared` so any future consumer can reuse them. No taxonomy changes — `marketing:lead_qualified` was already listed in `taxonomy.md` from Spec 0.
Spec & Plan
Notable
Test plan
🤖 Generated with Claude Code