Tag: Web Vitals

  • Supercharge Core Web Vitals with Amplitude’s Global Agent: Faster Rankings, Happier Users

    Supercharge Core Web Vitals with Amplitude’s Global Agent: Faster Rankings, Happier Users

    I measure product health by a simple equation: speed plus clarity equals trust. That’s why I prioritize Core Web Vitals and search performance together—because the fastest path to better UX and higher rankings is a closed loop between measurement, diagnosis, and action. Standardizing on Amplitude’s Global Agent with Amplitude AI Agents let my teams compress that loop from weeks to hours, and in many cases, to minutes.

    Learn how to track your web vitals and page rankings faster with Amplitude AI Agents and improve your site’s user experience and SEO rankings. That goal sounds ambitious, but with the right instrumentation and analytics workflow, it becomes a repeatable operating rhythm rather than a one-off project.

    Here’s what changed for us with Amplitude’s Global Agent: a single, consistent way to capture performance signals across pages and journeys, unified context for every session, and a lightweight footprint that doesn’t get in the way of speed. By centralizing measurement, we eliminated blind spots and gave product, growth, and engineering one shared truth for Core Web Vitals and behavioral analytics.

    My practical playbook is straightforward: 1) Establish a performance baseline for Core Web Vitals on key templates and critical user paths. 2) Segment results by device, location, acquisition channel, and content type to surface where users actually feel the friction. 3) Connect those vitals to downstream behaviors—scroll depth, engagement, and conversion—so we prioritize fixes that move business outcomes, not just lab scores. 4) Use feature flags and A/B testing to ship improvements safely and quantify uplift. 5) Close the loop with Agent Analytics to keep learnings visible and actionable.

    Operationally, we rely on anomaly detection to flag regressions early, CI/CD guardrails to prevent performance slips at deploy time, and observability plus session replay to accelerate root-cause analysis. This combination reduces mean time to resolution, protects page experience during fast iteration cycles, and helps us avoid trading UX for speed—or vice versa.

    The strategic benefit is compounding: better Core Web Vitals improve user perception and increase engagement, which strengthens SEO signals and, ultimately, page rankings. With a unified analytics platform in place, we can spotlight the few improvements that create outsized gains, then scale those patterns across the site with confidence.

    If your roadmap includes faster pages, stronger rankings, and happier users, align your teams around this simple loop: measure precisely, diagnose quickly, experiment safely, and learn continuously. Amplitude’s Global Agent and Amplitude AI Agents give you the instrumentation and insight to make that loop your competitive advantage.


    Inspired by this post on Amplitude – Best Practices.


    Book a consult png image
  • How to Scale Session Replay Without Sacrificing Privacy

    How to Scale Session Replay Without Sacrificing Privacy

    You want session replay on more journeys because the blind spots are expensive. A funnel can show where users leave, but it cannot show whether they encountered a broken control, a confusing message, a layout shift, or an error that never reached your analytics. Replay can turn those behavioral signals into enough context to make a product decision.

    The hard part is expanding that visibility without collecting data you should not have, degrading the experience you are trying to understand, or filling storage with recordings nobody will use. The answer is not a single masking setting. You need a capture contract, a delivery architecture, a sampling model, and an operating scorecard that treat performance, fidelity, and privacy as one system.

    Set the capture contract before you expand coverage

    Replay programs often begin with a coverage question: what percentage of sessions should you record? That is the wrong first question. Start with the decision you expect the recording to change. If nobody can name that decision, more coverage will create more cost and exposure without producing more insight.

    Write a capture contract for each product surface. This is a short, reviewable specification that connects a business purpose to technical controls. It should answer:

    • What question is replay meant to answer? Examples include diagnosing failed activation, explaining an error spike, or finding friction in a conversion step.
    • Which routes, components, and user cohorts are in scope? Name them. Do not approve an undefined all-product rollout.
    • Which data is prohibited? Include form values, credentials, payment details, message content, health information, account-recovery data, and any product-specific sensitive fields that apply.
    • What consent state permits capture? The recorder should not initialize before the required state is known. Withdrawal should stop capture and prevent queued data from being sent.
    • Who can watch a replay? Define roles by purpose. Product discovery, support investigation, engineering diagnosis, and administration do not automatically require identical access.
    • How long will the data remain available? Tie retention to the stated purpose rather than keeping replay indefinitely because storage permits it.
    • What sampling rule applies? State the baseline rate, targeted cohorts, exclusions, temporary overrides, owner, and expiry condition.

    Selective capture, redaction, consent, retention, role-based access, and environment-aware sampling are separate controls. Treating one of them as a substitute for the others creates predictable gaps. Masking does not grant consent. Restricted access does not make excessive collection necessary. Short retention does not make an exposed credential harmless.

    Apply those controls as close to collection as possible. A web replay is commonly reconstructed from serialized page state, changes, and interaction events. The privacy risk therefore sits in the data leaving the browser, not only in what the player later displays. A value hidden during playback may already exist in an outbound payload or stored record.

    A useful default is to block text and input values, then allowlist only fields proven safe and necessary. Add route-level and component-level exclusions for sensitive surfaces. Use a separate, time-bounded approval for diagnostic capture that needs greater fidelity. I would reject a policy that merely says to mask personal information: the term depends on context, and engineers cannot reliably implement an undefined category.

    Test the contract against the raw system, not just the player. Seed a non-production fixture page with recognizable test values, exercise every relevant component state, inspect the browser payload, inspect the stored representation, and verify that exports and downstream tools preserve the restriction. If a prohibited test value crosses the collection boundary, the control has failed even if the replay screen obscures it.

    Consent and retention obligations vary by jurisdiction, contract, and data type. Your privacy or legal owner must approve those rules for the markets you serve. Engineering can enforce an approved policy; it cannot infer that policy from a generic replay configuration.

    Keep capture off the user’s critical path

    Scalable replay starts in the browser, where your product competes with the recorder for main-thread time, memory, and bandwidth. A backend that can ingest billions of events does not help if the recorder makes an interaction sluggish or loses the DOM changes needed to explain the problem.

    The delivery design should make page experience more important than recording completeness. Decoupled capture and delivery, adaptive batching, compression, backpressure controls, and priority handling provide the basic pattern:

    1. Capture the minimum useful representation. Filter excluded nodes and values before serialization. Avoid collecting detail that no approved use case needs.
    2. Separate recording from transport. The capture path should write to a bounded queue rather than waiting for a network request. Upload latency must not become interaction latency.
    3. Batch adaptively. Small batches can reduce delay during quiet periods, while larger compressed batches can reduce request overhead during sustained activity. The policy should respond to queue pressure and network conditions.
    4. Define backpressure behavior. When production exceeds delivery capacity, the recorder needs a documented degradation order. Preserve navigation, consent changes, errors, and the structural events required for reconstruction before lower-value detail. Never freeze the page to protect the replay.
    5. Bound long sessions. Flush incrementally, cap memory use, and make reconnection behavior explicit. A queue that grows for the life of a tab will eventually turn a delivery problem into a page-performance problem.
    6. Make partial data visible. Mark gaps, dropped segments, and incomplete uploads. A replay that silently appears complete is more dangerous than one that clearly communicates its limits.

    Backpressure deserves special attention because it forces a product decision disguised as an implementation detail. If the system cannot retain everything, what must survive? The answer should come from the capture contract. An error marker without enough surrounding state may be useless, but exhaustive cursor movement may be expendable. Rank event classes before an incident forces the recorder to choose implicitly.

    Do not validate the client only on a fast laptop and stable connection. Use representative complex pages and test replay on and off under CPU pressure, constrained networking, rapid DOM change, background-tab transitions, reconnection, and long sessions. Compare Web Vitals, long tasks, memory growth, bytes transferred, queue drops, upload completion, and playback completeness. Long sessions, traffic spikes, complex interactions, and variable networks are precisely where an apparently sound design reveals its failure modes.

    There is no universal acceptable overhead that fits every product. Set budgets relative to your production baseline and the importance of the journey. A small regression on a frequently used mobile activation path may matter more than a larger regression on an internal administration page. Segment the results by route, browser, device class, network condition, and session length so averages do not hide the users most affected.

    Sample for decisions, not for a warehouse of footage

    A single global sample rate is easy to configure and hard to defend. It spends collection capacity uniformly even though product questions are not uniformly valuable. It can also miss rare failures while overrepresenting routine sessions that nobody will watch.

    Use a portfolio of sampling modes:

    • Random baseline sampling gives you a less biased view of ordinary behavior and lets you notice problems you did not predefine.
    • Cohort sampling increases visibility for a defined population such as new users, a browser family, a release cohort, or users entering a critical journey.
    • Signal-based sampling concentrates diagnosis around errors, failed steps, rage clicks, dead clicks, abnormal exits, or other instrumented friction signals.
    • Temporary diagnostic sampling raises fidelity for a narrow incident or release window, with an owner and an automatic expiry condition.
    • Hard exclusions override every sampling mode. A high-value investigation is not permission to collect from a prohibited surface or consent state.

    Onboarding, activation, high-friction conversion flows, and paths with disproportionate revenue or trust impact are sensible places to begin because a clearer diagnosis can change a meaningful decision. Signals such as errors, rage clicks, dead clicks, scroll behavior, and stalled progress can then help you find the sessions worth examining.

    Keep one statistical distinction clear. Targeted replay is good for explaining a known problem, but it cannot tell you how prevalent that problem is. If you record sessions because they contain an error, the resulting library will naturally make errors look common. Use analytics or a random baseline to measure frequency. Use replay to understand mechanism and context.

    A disciplined investigation looks like this:

    1. Find a measurable change in a funnel, cohort, error rate, performance signal, or support pattern.
    2. Define the affected population before opening replays.
    3. Review a deliberately selected set of relevant sessions and record recurring observable behaviors, not interpretations of user intent.
    4. Turn those observations into a falsifiable product or technical hypothesis.
    5. Instrument, release, or experiment so the hypothesis can be measured outside the replay player.

    This prevents two common mistakes: browsing memorable sessions until a story feels true, and treating one vivid recording as evidence of market-wide demand. Replay is strongest when it explains a quantitative signal and leads back to a measurable change.

    Run replay with a coupled performance, privacy, and value scorecard

    Session replay is not finished when playback works. It is an operating capability with client releases, configuration changes, storage growth, access decisions, and incident risk. Give it an owner and review the system across five dimensions.

    DimensionSignals to watchDecision the signals should trigger
    User experienceWeb Vitals, long tasks, main-thread work, memory growth, and replay bytesReduce capture detail, change delivery behavior, narrow coverage, or halt a rollout when the recorder breaks its budget
    Replay fidelityQueue drops, missing segments, incomplete uploads, event integrity, and playback reconstruction errorsFix prioritization or transport before teams rely on incomplete recordings for decisions
    Platform reliabilityIngestion failures, processing delay, retrieval latency, playback-start failures, and behavior during traffic spikesAdd capacity, repair a failing stage, or adjust sampling without shifting the problem into the browser
    Privacy and governanceRedaction test failures, capture outside approved consent states, retention exceptions, and access outside approved rolesDisable affected capture, contain the data, follow the approved deletion or incident process, and repair the control before restoring it
    Decision valueInvestigations that reached a useful replay, time to diagnosis, time to resolution, and product hypotheses validated outside replayMove coverage toward high-value use cases or retire collection that produces no action

    These dimensions constrain each other. Aggressive compression may improve bandwidth while hurting reconstruction. More capture may improve fidelity while violating the page budget. Narrow access may improve governance while blocking the support engineers responsible for incident response. The job is not to maximize any single metric; it is to keep the entire system inside approved boundaries.

    Version capture configuration like production code. A seemingly harmless selector change can expose text, remove necessary context, or increase mutation volume. Test recorder and configuration releases against fixture pages containing known sensitive values and known reconstructable interactions. Keep a rollback path.

    Prepare shutdown controls before launch. You should be able to stop capture for a component, route, environment, tenant group, or the whole product without waiting for a new application release. Document who can use each control, how queued data is handled, how affected stored data is identified, and when privacy, security, support, and engineering must be involved. If collection crosses a prohibited boundary, continuing to record while the team debates ownership compounds the exposure.

    Finally, connect replay operations to the workflows that consume it. Product teams need links from behavioral cohorts to relevant sessions. Support needs controlled escalation paths. Engineering and SRE need errors, network signals, layout shifts, and performance context close to the replay timeline. Connecting interaction context to observability and delivery workflows can shorten the path from an anomaly to a testable explanation, but only if the data remains trustworthy and accessible to the right roles.

    Key takeaways

    • Approve a capture contract for each surface before approving a broader sample rate.
    • Redact or exclude sensitive data before it leaves the browser; a masked player is not enough.
    • Protect the page with decoupled delivery, bounded queues, adaptive batching, and explicit backpressure priorities.
    • Keep random sampling for prevalence and use targeted sampling to explain known signals.
    • Operate performance, fidelity, platform reliability, privacy, and decision value as a coupled scorecard.
    • Require scoped shutdown controls, retention handling, access ownership, and rollback before production expansion.

    Before you increase replay coverage, ask for two artifacts: a one-page capture contract for the next journey and a replay-on versus replay-off test under that journey’s difficult conditions. If the team cannot show what is allowed to leave the browser, how the page stays within budget, and which decision the recordings will change, the rollout is not ready to scale.

    References

  • Amplitude Browser SDK: Turn Web Vitals Into Product Decisions

    Amplitude Browser SDK: Turn Web Vitals Into Product Decisions

    You have Web Vitals in a dashboard, but the hard question is still unanswered: does a slower or less stable experience materially change activation, conversion, or retention? If your instrumentation cannot answer that, collecting more performance data will only make the dashboard busier.

    The useful setup is not simply Browser SDK plus LCP, INP, and CLS. It is a measurement system that preserves the user’s real experience, attaches enough product context to explain the result, and connects performance to an outcome your team can improve.

    Build the measurement contract before the dashboard

    Start with the decision you want to make. A good Web Vitals implementation should tell you which experience is degraded, who encounters it, whether it is associated with a meaningful product outcome, and which intervention deserves engineering time.

    I would use one normalized event, such as web_vital_observed, rather than inventing event names for every metric and route. The metric, value, page context, and audience context then become properties. That keeps the taxonomy manageable while preserving the dimensions needed for analysis.

    Retain the raw measurement

    Record LCP, INP, and CLS as distinct metric names with their raw values and units. LCP and INP are timing measures, while CLS represents visual stability, so combining their values in one aggregate would be meaningless. A separate metric-name property lets one event schema support all three without pretending that they are interchangeable.

    Do not put labels such as good, acceptable, or poor into the event name. If you want performance bands, derive them from the raw value during analysis or store the band as an additional property. Keeping the underlying value allows you to change a threshold without rewriting history.

    Add context that leads to a decision

    The minimum useful context is not the maximum available browser context. Attach only properties that help you isolate a problem or compare an outcome:

    • page_group: a stable product category such as landing page, pricing, signup, checkout, or application workspace.
    • device_class: enough detail to separate materially different experiences without creating a fragmented taxonomy.
    • geography: the approved regional level, not unnecessarily precise location data.
    • traffic_source: useful when acquisition channels land users on different page experiences.
    • user_cohort: new, returning, activated, subscribed, or another state that matters to your product.
    • experiment_variant and release_id: the connection between a performance change and the product change that may have caused it.
    • measurement_timestamp: when the experience occurred, kept separate from the time Amplitude received the event.
    • sampling_policy: whether the event came from full collection or a documented sample.

    Prefer a controlled page group over an unrestricted URL. Raw URLs can create excessive cardinality, split one product surface across many records, and expose identifiers or query-string data that should not enter analytics. Normalize the route and redact sensitive values before transmission.

    Your event contract is ready when an analyst can move from a weak metric distribution to a specific page group, audience, release, and business outcome without asking engineering to reconstruct the session.

    Protect the experience from the code measuring it

    A Browser SDK runs in the same environment whose performance you are trying to understand. That makes collection overhead part of the product decision. An analytics implementation that worsens loading or responsiveness is not merely inefficient; it contaminates its own measurement.

    Treating the Amplitude Browser SDK as a product surface leads to five practical requirements.

    1. Keep the client-side footprint and payload focused. Collect properties that support segmentation or governance, not every value the browser can expose.
    2. Make telemetry fail safely. Rendering, navigation, and interaction must continue if analytics initialization, collection, or delivery fails.
    3. Use offline queuing and retry behavior without confusing delivery time with experience time. A delayed event still belongs to the session and release in which it was measured.
    4. Sample consistently when full collection is unnecessary. A stable sampling policy is more defensible than selectively collecting only certain devices, routes, or observed performance states.
    5. Put schema validation and compatibility checks in CI/CD. Product releases should not silently rename properties, change units, or remove the context that existing dashboards depend on.

    Sampling deserves particular care. If slow sessions are more likely to be abandoned, a delivery mechanism that captures only completed journeys can underrepresent the experience you most need to see. Keep collection independent of the outcome wherever possible, document the sampling rule, and monitor coverage by page group and device class. A sample is useful only when you know what population it represents.

    Retries create a different risk: duplicate or chronologically misplaced observations. Use a stable measurement identifier when your implementation needs deduplication, and preserve the original measurement timestamp. Otherwise, a recovered connection can make an earlier performance problem appear to belong to a later release.

    Make privacy part of the event design

    Consent-aware collection, edge redaction, and regional routing should be decided before rollout. Do not send a property and hope to clean it later. Once sensitive data enters an analytics pipeline, deletion and access obligations become harder to manage across queues, retries, exports, and downstream reports.

    Review each property with a simple test: does this value materially change a product decision? If a precise URL, identifier, or location does not pass that test, replace it with a stable category or leave it out.

    Analyze distributions alongside product outcomes

    An average Web Vital hides the pattern product teams need. One page can look acceptable on average while a valuable device segment or acquisition cohort has a consistently poor experience. Start with distributions, then segment them by page group, device, geography, traffic source, and user cohort.

    Next, pair those performance distributions with funnels and cohorts. Compare activation, conversion, retention, or revenue outcomes across ranges of LCP, INP, and CLS. Keep the metrics separate, because load speed, responsiveness, and visual stability can affect different moments in a journey.

    QuestionAmplitude viewDecision it supports
    Where is the experience degraded?Metric distribution by page group and device classSelect the surface and audience to investigate
    Does the degradation matter to the product?Outcome rate across performance rangesEstimate the strength and shape of the association
    Which change caused an improvement?Experiment variant compared on both the vital and the outcomeShip, revise, or reject the intervention
    Did a release create a regression?Performance distribution trended by releaseEscalate, roll back, or investigate the affected page group

    Look for a cliff rather than assuming a smooth relationship. Conversion might remain similar across much of the distribution and then deteriorate after a particular range. That pattern gives you a more useful target than a site-wide average: move the affected population away from the range where the outcome changes.

    Do not confuse that pattern with causation. Device capability, network conditions, geography, traffic source, and user intent can affect both performance and conversion. Segmentation reduces obvious confounding, but it does not eliminate it.

    Use experiments to prove the product effect

    Once you find an important association, test an intervention. Image optimization, lazy-loading changes, and navigation changes are useful candidates because each can alter a specific part of the experience. Randomize the intervention, not the Web Vital, and measure two results together:

    • Did the treatment improve the intended LCP, INP, or CLS distribution?
    • Did the same treatment improve activation, conversion, retention, or another declared outcome?

    A treatment that improves a performance score but leaves the product outcome unchanged may still be worthwhile for experience quality or regression prevention. It should not, however, be presented as a proven growth lever. Conversely, an outcome lift without the expected Web Vital movement means your proposed mechanism was probably incomplete.

    Prioritize opportunities using four factors: the size of the affected population, the outcome gap associated with the performance range, your confidence that the relationship is actionable, and the team’s ability to change the relevant surface. This keeps a dramatic problem on a low-traffic page from automatically outranking a smaller but widespread problem in signup or checkout.

    SEO can be a compounding benefit, but it should not replace the product case. Improve the experience for real users, verify the effect on their behavior, and treat search performance as a downstream outcome rather than the sole reason to optimize a synthetic score.

    Turn the first week into an operating loop

    Start with your top three entry pages. A one-week diagnostic is a sensible time box for establishing visibility, not a promise that you will prove causality in seven days. The first goal is to expose the distribution, validate the event quality, and identify one segment worth investigating.

    1. Choose three entry pages and assign each to a stable page group.
    2. Instrument LCP, INP, and CLS with the same normalized contract.
    3. Verify coverage, missing properties, sampling behavior, timestamps, consent handling, and unexpected values before interpreting a chart.
    4. Plot each metric’s distribution by page group and device class.
    5. Overlay one outcome that occurs close enough to the experience to support a useful decision, such as signup completion or activation.
    6. Select one high-impact segment and define an intervention that could plausibly change its experience.

    Keep the first scope narrow. Adding every route, cohort, and outcome at once creates an instrumentation program before you have proven that the model produces decisions. Once the first three pages generate a credible hypothesis, extend the same event contract instead of creating a new one for every squad.

    Define ownership before the first regression

    Product should own the page groups, business outcomes, and prioritization logic. Engineering should own collection performance, delivery resilience, release metadata, and regression guardrails. Data or analytics should own schema quality, coverage checks, and the analytical definitions used in dashboards. The appropriate privacy owner should approve consent behavior, PII controls, and regional routing.

    Then define product-level service objectives for LCP, INP, and CLS by key page group. Review performance distributions beside activation and retention in QBRs, and add release guardrails so a feature cannot quietly trade away responsiveness or stability. A site-wide objective is too blunt if signup and a low-traffic support page carry different user and business consequences.

    Your instrumentation is operational when it has all of the following:

    • A versioned event contract with documented metric units and required properties.
    • Automated checks that catch schema drift during CI/CD.
    • Known coverage and sampling behavior across important page and device groups.
    • Consent, redaction, and routing rules applied before data leaves the browser.
    • A distribution view for each Core Web Vital rather than one blended score.
    • At least one product outcome connected to the performance experience.
    • A named owner and a release response for regressions.

    This is where Web Vitals stop being a periodic performance project. They become a shared decision system for product, engineering, analytics, and privacy.

    Key takeaways

    • Use one normalized Web Vitals event and preserve the raw metric value; derive performance bands without discarding the underlying measurement.
    • Attach stable page, audience, experiment, release, timestamp, and sampling context only when it supports analysis or governance.
    • Keep analytics collection lightweight, failure-tolerant, consent-aware, and protected by schema checks.
    • Analyze distributions by meaningful segments, then connect them to activation, conversion, retention, or revenue.
    • Treat correlations as hypotheses. Use an experiment to verify that a performance intervention also changes the intended product outcome.
    • Begin with three entry pages, one nearby outcome, and one actionable segment before expanding coverage.

    On your next instrumentation ticket, require three fields beyond the SDK task: the decision the data will support, the outcome it will be joined to, and the owner who will respond when it regresses. That small change turns Web Vitals collection from telemetry into product management.

    References