Skip to main content

Solution Pack: Performance-Critical Lead Funnel

Architecture summary

Decision: build a server-rendered or statically cached acquisition funnel with minimal critical JavaScript, strict third-party governance, consent-aware measurement, route-level Web Vitals budgets, experiment isolation, and fast rollback for variants.

System sketch

Key decisions

DecisionChoiceReason
Renderingstatic/edge-cached shell with hydrated form islandfastest first useful state and low JavaScript
Measurementfirst-party typed collectorprivacy, control, and destination governance
Experimentsserver or edge assignment where possibleavoids layout shift and client flicker
Third partiesdeny-by-default on critical pathprotects LCP, INP, privacy, and reliability
Form submissionserver-validated mutation with idempotencyprevents duplicate leads and unsafe trust

Performance budget

BudgetTarget evidence
LCPfield p75 by route, device, campaign
INPp75 form interaction and CTA click
CLSvariant and font/image stability
JavaScriptcritical route bundle cap
Third-party costtransfer and main-thread budget per vendor

Failure matrix

FailureUXControl
lead API timeoutpreserve form and retryidempotency key and retry state
analytics blockedlead workflow continuesfirst-party collector and delivery metric
experiment misconfigureddefault variantserver-side flag rollback
attribution unavailabledashboard shows uncertaintyno product flow dependency
script causes INP regressiondisable vendorscript budget alert and kill switch

ADR bundle

ADR 1: Static or edge-cached shell with form island

Context: the funnel is acquisition-critical and most visitors need content and a lead form, not a full app shell.

Decision: render the marketing content as static or edge-cached HTML and hydrate only the form, experiment exposure, and consent-aware measurement.

Consequences:

  • excellent first useful state
  • lower JavaScript and hydration cost
  • requires careful cache variation for experiments and locale
  • dynamic personalization must be isolated

Verification:

  • p75 LCP by campaign and device
  • JavaScript transfer budget
  • CLS by variant
  • cache hit ratio

ADR 2: First-party measurement gateway

Context: the funnel needs conversion analytics, attribution, experiments, and performance telemetry without uncontrolled vendor collection.

Decision: send typed events to a first-party collector, then route to destinations by consent, purpose, and policy.

Consequences:

  • stronger privacy and schema control
  • more platform implementation work
  • easier vendor replacement
  • better sensitive-field rejection

Verification:

  • event schema validation failure rate
  • events dropped by consent/policy
  • sensitive-field rejection tests
  • destination routing audit

ADR 3: Experiment assignment outside the critical client path

Context: client-side experiment flicker and late variant loading can harm LCP, CLS, and trust.

Decision: assign variants server-side or at the edge where possible. Client-side experiments are allowed only for low-risk, post-load enhancements.

Consequences:

  • better visual stability
  • more cache-key complexity
  • requires experiment metadata in observability

Verification:

  • CLS by variant
  • cache key review
  • rollback by variant flag
  • conversion and Web Vitals segmented together

Review gates

GateRequired evidence
Performanceroute budget, Web Vitals dashboard, trace for form interaction
Privacyconsent-aware loading and event schema review
Third-partycompleted third-party register with kill switches
Experimentationcache/variant safety review and rollback plan
Reliabilitylead submit idempotency and retry behavior
Accessibilityform labels, errors, focus, and target-size review

Rollout plan

  1. Launch baseline route with no experiments and no nonessential third parties.
  2. Verify Web Vitals and form completion.
  3. Add analytics through first-party collector.
  4. Add one experiment with server/edge assignment.
  5. Add attribution pilot only after privacy and browser-support review.
  6. Review performance and conversion together before expanding campaign traffic.

Strong reviewer concerns

  • Do not let marketing tags bypass the first-party collector.
  • Do not treat attribution numbers as exact truth.
  • Do not ship variant assignment that creates layout shift.
  • Do not measure only Lighthouse; field data by route/campaign/device is required.

Portfolio artifacts

  • route budget table
  • third-party register
  • experiment rollout plan
  • attribution uncertainty note
  • lead form mutation ADR
  • Web Vitals dashboard specification