Skip to content

Analytics for WebGPU apps

A WebGPU app usually ships two renderers: WebGPU where the browser and GPU support it, and a WebGL2 fallback everywhere else. That makes your audience two audiences, and page analytics can’t tell them apart. Analytics for a WebGPU app answers questions such as these:

  • How many visitors actually get WebGPU, and how many fall back to WebGL2?
  • Is the WebGPU path faster for real users, or only on your own machine?
  • Which GPUs and browsers lose the device or hit validation errors?
  • Does a WebGPU failure end the session, or does the fallback save it?

Uptimizr records the graphics API of every session automatically, so each heatmap, FPS chart and funnel can be split by WebGPU and WebGL. It’s open source (Apache-2.0), self-hosted, and the same connectors cover both renderers.

Engine Connector WebGPU
three.js @uptimizr/three Pass a WebGPURenderer from three/webgpu exactly like a WebGLRenderer
Babylon.js @uptimizr/babylon Works the same on WebGPUEngine as on the WebGL Engine
Babylon Lite @uptimizr/babylon-lite WebGPU-only; trackSceneAsync also records the native backend (Metal, Direct3D 12, Vulkan)
PlayCanvas @uptimizr/playcanvas Records WebGPU when the app runs on PlayCanvas’s WebGPU graphics device

With three.js, for example:

import { WebGPURenderer } from "three/webgpu";
import { trackScene } from "@uptimizr/three";
const renderer = new WebGPURenderer({ antialias: true });
await renderer.init();
const client = trackScene(scene, camera, renderer, {
projectId: "my-webgpu-app",
endpoint: "https://collect.example.com",
});

See the three.js, Babylon.js, Babylon Lite and PlayCanvas connector pages for each engine’s setup.

The graphics API of every session (always on)

Section titled “The graphics API of every session (always on)”

Each session starts with a graphics block: the API (webgpu, webgl2 or webgl), the shading language (wgsl or glsl-es), the API version and, where the engine exposes it, the native backend underneath. It’s coarse, non-personal and on by default in every JavaScript connector.

The dashboard’s Rendering technology panel shows the mix, backed by GET /api/v1/rendering-technology. That’s your WebGPU adoption rate, from your own visitors rather than global browser statistics.

GET /api/v1/perf/by-device splits each session’s median FPS by graphics backend, mobile flag, GPU renderer, browser and operating system. That’s where you find out whether WebGPU is faster for real users, and on which hardware the fallback struggles. Babylon.js also reports p95 and p99 frame time and long frames, which show stutter that an FPS average hides. See Measure real-user FPS in WebGL for why your own GPU isn’t a useful benchmark.

Engines choose their backend when they start and don’t announce a fallback, so report it from your app when it happens:

// after WebGPU initialization fails and you fall back to WebGL2:
client.reportCapabilityChange({ kind: "graphics-backend", from: "webgpu", to: "webgl2" });

Read the rollup from GET /api/v1/capabilities. Quality and LOD downgrades use the same call with kind: "quality". See Capability changes.

Device loss and validation errors (opt-in)

Section titled “Device loss and validation errors (opt-in)”

WebGPU failures are often specific to one GPU, driver or browser, so they rarely show up in testing. With the captureGraphicsDiagnostics client option on, the Babylon.js and three.js connectors report:

  • Device loss, from the GPUDevice lost promise. A loss your app requested is marked info; any other loss is fatal.
  • Uncaptured errors, such as validation and out-of-memory errors, as a rate-limited rollup per session, so an error storm can’t flood the collector.
  • Context-creation failure, when the WebGPU or WebGL context can’t be created at all.
  • Shader compilation failures, including WGSL shader-module compilation messages. Shader source is stripped unless you opt in separately.

These appear in the dashboard’s Engine diagnostics panel, backed by GET /api/v1/graphics-diagnostics. The Babylon.js connector also tags each one with the camera position, so the Error heatmap (3D) panel shows where in the scene things break. Diagnostic text can contain details of your application, so the option is off by default and every message passes through your beforeSend hook. trackScene doesn’t take it: set it on a hand-built client, as Engine diagnostics shows.

The graphics API changes how a scene is drawn, not what visitors do in it. Click and view-direction heatmaps, mesh rankings, blind spots, funnels and session replay work identically on WebGPU and WebGL. Replay re-drives the recorded events in your own scene rather than playing back pixels, so it doesn’t depend on the renderer the visitor had.

Does analytics slow down a WebGPU scene? The connectors sample the camera at about 1 Hz, the pointer at about 4 Hz and FPS every two seconds by default, and send events in batches. Gaze capture adds one raycast per camera sample that’s sent. Sampling rates are configurable; see Capture fidelity.

Can I see which native backend WebGPU used? On Babylon Lite, trackSceneAsync records Metal, Direct3D 12 or Vulkan. Babylon.js, three.js and PlayCanvas don’t expose it, so those sessions record the WebGPU API without the native backend. For WebGL sessions, the connectors infer the backend from the ANGLE renderer string.

Does Google Analytics show this? No. A page analytics tool sees one <canvas> element, not the renderer behind it. See Why Google Analytics can’t see inside a 3D scene.

What does it cost? Uptimizr is free and open source. You pay for wherever you host the collector.