feat(pixel): auto-capture form submissions and outbound link clicks#2833
Merged
bkbooth merged 2 commits intoApr 8, 2026
Conversation
…clicks Add passive event capture for form submissions and outbound link clicks, firing as TrackMessage events with surface: 'pixel'. Both use single document-level listeners (event delegation) and respect consent state. Form submissions capture formAction, formId, formName, fieldNames, and at full consent, SHA-256 hash email values client-side before enqueuing. Outbound link clicks capture linkUrl, linkText, elementId, outbound flag. Both configurable via autocapture init option. Bundle impact: ~0.5KB gzipped (total pixel bundle: 4.1KB gzipped). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit b472566
☁️ Nx Cloud last updated this comment at |
nattb8
reviewed
Apr 8, 2026
When crypto.subtle is unavailable (HTTP pages, some privacy browsers, Safari <15 non-secure contexts), enqueue form_submitted without emailHash rather than silently losing the event entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nattb8
approved these changes
Apr 8, 2026
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
Implements SDK-52: passive event capture for form submissions and outbound link clicks — the two most valuable conversion signals the pixel can collect without any studio instrumentation.
submitlistener capturesformAction,formId,formName,fieldNames. Atfullconsent, SHA-256 hashes email values client-side before enqueuing (raw email never enters the queue). Atanonymous, captures form metadata only. Silent atnone.clicklistener targets<a>tags where hostname differs fromwindow.location.hostname. CaptureslinkUrl,linkText(truncated to 256 chars),elementId,outbound: true. Silent atnone.autocapture: { forms: true, clicks: true }in init options (both default to true)Files changed
autocapture.tsautocapture.test.tspixel.tstrack()helper,autocaptureoptionpixel.test.tsindex.tsAutocaptureOptionstypeTest plan
anonymous(no email hash), fires with SHA-256 email hash atfull, silent atnonenoneautocapture: { forms: false }disables form listener,{ clicks: false }disables click listener<a>ancestor🤖 Generated with Claude Code