Skip to main content

Query Web Analytics from the Vercel CLI

By Steven Van ·

The new `vercel metrics` command queries page views, visitors, and custom events from the terminal, no Observability Plus required.

Vercel's CLI can now query Web Analytics data directly from the terminal. The new vercel metrics command pulls page views, visitors, and custom events for a project, and works without an Observability Plus subscription.

The command can reproduce the views already in the Web Analytics dashboard, such as daily page views over the last week, top countries by traffic, or unique visitors in a given period, plus queries the dashboard doesn't support:

  • Filtering by multiple path prefixes or excluding a value, with results grouped by path and device type
  • Filtering and grouping by custom event properties, such as event data fields
  • Grouping by UTM source and campaign alongside feature flag values
  • Querying production traffic across every project in a team at once

Bounce rate isn't available through the CLI and still requires the dashboard. Vercel notes the command also lets a coding agent with CLI access answer traffic questions directly, such as which pages gained the most visits or which campaigns drove the most signups. Full details are in the documentation.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Read the original announcement →

Read Query Web Analytics from the Vercel CLI on Creators Toolbox