Explicit-Range Consent Statistics

Inclusive local dates, sparse buckets, rate formulas and completeness.

Content and code last checked 2026-10-06 by ConsentEase product documentation. This is a review of the written content and code, not a test on a live third-party platform.

Read-only endpoint

GET /api/v1/sites/:id/consent-stats requires sites:read. MCP exposes the same aggregate through consentease_get_consent_stats.

curl --fail-with-body \
  'https://consentease.io/api/v1/sites/SITE_ID/consent-stats?from=2026-09-01&to=2026-09-30&tz=Europe%2FBrussels' \
  -H "Authorization: Bearer $CONSENTEASE_API_KEY"

Period validation

from and to are required real YYYY-MM-DD dates; both are inclusive, with at most 366 calendar days. tz is an optional valid IANA zone, default Europe/Brussels; numeric offsets are not accepted. Invalid inputs return 400, missing scope 403, missing/foreign site the same hidden 404.

Local midnights determine membership; daylight-saving days can last 23 or 25 hours. This does not change the dashboard's UTC rollups.

Totals and rates

The response contains site:{id,domain}, period:{from,to,tz}, generatedAt (UTC), totals, rates, daily, weekly, devices, countries and dataCompleteness.

totals contains impressions, accepts, rejects, customs, dismissals and noInteraction. Event mapping: banner_shown, accept, reject, preferences_saved and banner_dismissed.

noInteraction = max(0, impressions − accepts − rejects − customs − dismissals).

rates contains acceptRate, rejectRate, customRate, dismissalRate and noInteractionRate: percentages of impressions, rounded to one decimal. No impressions gives null, while a measured 0% stays numeric zero. Instrumentation is not repaired/deduplicated; rates can exceed 100% when outcomes and impressions are inconsistent.

Buckets and dimensions

  • daily includes only local dates with recorded analytics events; missing days are not fabricated as zeros.
  • weekly uses ISO week-year labels and full Monday–Sunday from/to labels, but counts only events within the requested period.
  • Each bucket has the same counts/rates; clamped residuals are computed within it, not summed from other clamped buckets.
  • devices and countries return at most 10 groups, ordered by impressions then label. Each includes impressions and acceptRate; unknown/unrecognised values become unknown.

Completeness is not coverage

dataCompleteness contains firstEventAt, lastEventAt (UTC within the selected range or null), daysWithData and daysInPeriod. Any analytics event can make a day count as having data. This does not prove continuous instrumentation.

An empty period returns zero totals, null rates, empty bucket/dimension arrays and null first/last timestamps. The route returns no raw visitor IDs, IPs or event records, and no revenue/conversion estimates or legal score.

Each successful dispatch records a non-billable read audit; retries do not deduplicate reads.

Related articles

Still need help?

Contact the ConsentEase team and include the website and steps you tried.