Count Events

Count a single activity event over a window, with an optional dimension breakdown.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Counts how many times a single event (event_name) occurred for the site over the window, and — when group_by is supplied — breaks that total down by one dimension.

  • Dimensions (group_by): page, referrer, country, platform, utm_source, utm_medium, utm_campaign. Each bucket's percentage is its share of total.
  • Without group_by, only total is returned and data is empty.
  • Per-customer: pass user_id to scope the count to one customer; the customer must belong to the site (otherwise 404).

Use it for questions like "how many subscriptions were created last month, by referrer?"

Query Params
integer
required

The site ID to scope this request to.

string
required

The customer-activity event to count. Common values: "Page Viewed", "Subscription Created", "Registered", "Logged In", "Newsletter Email Submitted", "Paywall Displayed". The valid set is per-site; an unrecognized value returns a 400 listing the events this site has recorded.

string
enum

Optional breakdown dimension. When omitted, only the total is returned.

Allowed:
integer
≥ 1

Scope the result to a single customer belonging to the site. Returns 404 if the customer is not on this site.

date

Start of the window in YYYY-MM-DD. Use with to. When omitted, a trailing default window is used. The from–to span is capped at the site’s activity retention window (90 days by default).

date

End of the window in YYYY-MM-DD. Must be on or after from and no later than today.

integer
1 to 90

Alternative to from/to: size of the trailing window in days (1–90). Bounded by the site’s activity retention window.

integer
1 to 100

Maximum number of breakdown buckets to return (1–100, default 10). Ignored when group_by is omitted.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json