Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Keys belong to one project: every call reads that project only.
- Dates are YYYYMMDD without dashes; times follow the project’s time zone. Event and property names with spaces must be URL encoded (the client does this).
- Limits: 5 concurrent requests per key. Queries also spend a per-project cost budget (1,000 concurrent, 108,000 per hour): cost = days x conditions x query-type cost, at least 10, with ranges under 7 days counted as 7. 429 when exceeded; honour Retry-After.
- Events (e, e2, se, re) are JSON objects {event_type, filters, group_by}; filters are [{subprop_type: event|user, subprop_key, subprop_op, subprop_value: [..]}] with ops is, is not, contains, does not contain, less, greater, set is, … Custom user properties take a gp: prefix.
Endpoints
Get a saved chart’s results
- The answer’s shape depends on the chart type, and follows the chart’s current definition: edits to the chart change it.
- A chart from another project answers 400; use that project’s keys.
Query event segmentation
Query a funnel
Query retention
- In each value list, index 0 is the cohort size and index N+1 is retention N intervals out (index 1 is day 0). Dates come newest first.
Count active or new users
Break users down by a property
Get average session length
Get revenue lifetime value
List event types
Find a user
- No match is a 200 with type ‘nomatch’ and an empty matches list.
- Shares a per-project budget with user activity: 10 concurrent and 360 per hour.
Get a user’s event stream
- Shares a per-project budget with user search: 10 concurrent and 360 per hour.