OrbitsDocs
esc
    Open Orbits
    ObserveSpeed Insights

    Speed Insights

    Core Web Vitals from real visits to your production site, on your visitors' own phones and networks, with the slowest routes and the elements behind them. Add `@useorbits/speed-insights` and turn it on for the project. Pro plan.

    How it works

    Speed Insights measures how fast your pages load and respond for the people actually using them. Like Analytics, it has two halves:

    1. A switch on the project. Turning Speed Insights on makes your production addresses serve Orbits' script, /_orbits/speed-insights.js, and record what it sends.
    2. A small package in your app, @useorbits/speed-insights, which loads that script from your site's own address.

    The script measures five Web Vitals with Google's web-vitals library and sends them together, in one report per page load, when the visitor leaves the page. Reports go to /_orbits/e on your own host; they never reach your app. Only production deployments are measured.

    1. Turn it on

    Open the project, choose Speed Insights and press Turn on Speed Insights. Owners, admins and members can switch it; viewers can't. The change reaches your addresses within seconds. Until reports arrive, the page says Speed Insights is on and shows the snippet to add. Turn it off at the foot of the page stops it.

    2. Install the package

    Terminal
    $ npm install @useorbits/speed-insights

    Add it once, where your framework renders on every page.

    Each page load is reported against the route that served it (/blog/[slug]).

    app/layout.tsx
    import { SpeedInsights } from "@useorbits/speed-insights/next";
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <body>
            {children}
            <SpeedInsights />
          </body>
        </html>
      );
    }

    With the Pages Router, render it in pages/_app.tsx instead.

    Deploy to production. Reports show as real visitors browse.

    What's measured

    MetricWhat it tells youGoodThe element named
    LCP, Largest Contentful PaintWhen the main content appeared2.5 s or lessThe largest element
    INP, Interaction to Next PaintHow quickly the page responds to taps and clicks200 ms or lessThe one interacted with
    CLS, Cumulative Layout ShiftHow much the layout jumps around while loading0.1 or lessThe one that shifted most
    FCP, First Contentful PaintWhen anything first appeared1.8 s or less
    TTFB, Time to First ByteHow long the server took to start answering0.8 s or less

    LCP, INP, FCP and TTFB are in milliseconds; CLS is a score with no unit. Each report also carries the connection the visitor was on (4G, 3G and so on) where the browser says.

    Reading the page

    Choose a Device, Mobile (tablets count as mobile) or Desktop, and a Time range: 24 hours, 7 days (the default) or 30 days. Every figure is the 75th percentile (p75): the value three in four page loads did better than.

    Panel
    Real experience score0 to 100, from the p75s there are (below)
    Each metricIts p75 against the good line
    Largest paint over timeLCP's p75, bucket by bucket
    By routeThe most visited routes, ten at most, each with every vital's p75. Slowest first sorts them
    What's slowing itThe elements (as CSS selectors) most often behind LCP, INP and CLS, five each, with how often and their p75
    ConnectionsLCP samples by the connection they were measured on

    Routes are the ones your framework named (Next.js, SvelteKit and Astro report them), or else the path with its ids grouped (/products/8412 is /products/[id]).

    How the score is worked out

    Each metric's p75 is scored the way Lighthouse scores it, 90 at its good line and 50 at its median, then weighted:

    MetricWeight
    FCP15%
    LCP30%
    INP30%
    CLS25%

    TTFB is shown, not scored. With no reports at all, there is no score.

    Options

    <SpeedInsights /> takes the same options as injectSpeedInsights():

    OptionDefault
    sampleRate1The share of page loads that report, from 0 to 1. On a busy site, 0.5 reports half.
    beforeSendA function that gets each report before it's sent. Return it, changed or not, or null to drop it.
    mode"auto""development" measures nothing; "auto" is development in a dev build or on localhost.
    debugfalseLog each report the script sends.
    scriptSrc"/_orbits/speed-insights.js"Where the script is loaded from.
    endpoint"/_orbits/e"Where reports go.
    tsx
    <SpeedInsights sampleRate={0.5} />

    The Astro component can't take a function: set window.orbitsSpeedInsightsBeforeSend before it renders instead.

    Privacy

    Speed Insights follows the same rules as Analytics: no cookies, no IP addresses stored, nothing sent in development, and bots and headless browsers left out. See Analytics › Privacy.

    In the weekly summary

    When the team's weekly summary is on, it includes mobile Web Vitals from the busiest project that has Speed Insights.

    From the API

    Call
    GET /v1/teams/{team}/projects/{project}/speed-insights?device=mobile&range=7dThe page's numbers. { "enabled": false } while it's off
    PUT .../speed-insights with { "enabled": true }Turn it on or off. On Free, turning it on is 402 with code: plan_required

    See API › Insights.

    Was this page helpful?

    Updated