Sites

Get site analytics

Changed on

Returns traffic analytics for a site over a date range: pageview/visitor totals, new vs. returning visitors, a default conversion funnel, a per-day time series, and top pages, referrers, and dimensional breakdowns (device, browser, OS, geography, and UTM parameters). Defaults to the last 30 days; the range cannot exceed 366 days.

get/sites/{id}/analytics

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

Query parameters

start_date, string date

Start of the date range (inclusive), as an ISO-8601 date (YYYY-MM-DD). Defaults to 29 days before end_date, so the default range is the last 30 days including today.

end_date, string date

End of the date range (inclusive), as an ISO-8601 date (YYYY-MM-DD). Defaults to today.

Response

Site analytics for the requested period

object required
object, 'site_analytics' required
site_id, string required

Prefix id of the site (e.g. site_abc123).

period, object required

The resolved date range the metrics cover.

totals, object required

Aggregate pageviews and unique visitors over the period.

new_vs_returning, object

Visitors active in the period split by whether their first-ever visit was before the period started.

funnel, object[]

Ordered conversion funnel; each stage counts visitors who reached it within 24h of the first stage.

by_day, object[]

Per-day pageviews and visitors time series.

top_pages, object[]

Top 20 pages by pageviews.

top_referrers, object[]

Top 20 referrer hosts by visitors.

custom_events, object[]

Top 20 custom events by hit count, with unique visitors and any associated revenue.

by_device, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_browser, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_os, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_country, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_region, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_city, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_utm_source, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_utm_medium, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

by_utm_campaign, object[]

Top 20 values for a single analytics dimension, ranked by unique visitors.

Example response

{
  "object": "site_analytics",
  "site_id": "site_ExD8Y6PWw0xJrfD9QKVgvnRZ",
  "period": {
    "start_date": "2026-05-05",
    "end_date": "2026-06-04"
  },
  "totals": {
    "pageviews": 1820,
    "visitors": 642
  },
  "new_vs_returning": {
    "new_visitors": 511,
    "returning_visitors": 131
  },
  "funnel": [
    {
      "label": "Visit",
      "visitors": 642
    },
    {
      "label": "Product view",
      "visitors": 188
    },
    {
      "label": "Checkout",
      "visitors": 54
    },
    {
      "label": "Purchase",
      "visitors": 21
    }
  ],
  "by_day": [
    {
      "date": "2026-06-04",
      "pageviews": 96,
      "visitors": 38,
      "new_visitors": 29,
      "returning_visitors": 9
    }
  ],
  "top_pages": [
    {
      "path": "/",
      "pageviews": 820,
      "visitors": 410
    }
  ],
  "top_referrers": [
    {
      "source": "google.com",
      "pageviews": 240,
      "visitors": 180
    }
  ],
  "custom_events": [
    {
      "event_name": "purchase",
      "hits": 21,
      "visitors": 21,
      "revenue": 1049.79
    }
  ],
  "by_device": [
    {
      "value": "mobile",
      "pageviews": 1100,
      "visitors": 402
    }
  ],
  "by_country": [
    {
      "value": "US",
      "pageviews": 900,
      "visitors": 360
    }
  ]
}

Changes

    • info

      added the optional property by_day/items/new_visitors to the response with the status

    • info

      added the optional property by_day/items/returning_visitors to the response with the status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    3 more changes in this revision