Funnels
Save conversion funnels of pages and events, change them, and run them through the API.
Authentication
Requires a root client or a key with the funnels:write permission. A key for one project can only manage that project's funnels. Running a funnel needs analytics:read.
Base URL
https://api.actuallytracking.com/manage/projects/{projectId}/funnelsEndpoints
| Method | Path | Description |
|---|---|---|
GET | /manage/projects/{projectId}/funnels | List the project's saved funnels |
GET | /manage/projects/{projectId}/funnels/{funnelId} | Get one funnel |
POST | /manage/projects/{projectId}/funnels | Save a funnel |
PATCH | /manage/projects/{projectId}/funnels/{funnelId} | Change a funnel |
DELETE | /manage/projects/{projectId}/funnels/{funnelId} | Delete a funnel |
GET | /insights/{projectId}/funnels/{funnelId} | Run a funnel: visitors and conversion at each step |
A funnel is a funnel chart on a dashboard, so every funnel you save through the API also shows up in the dashboard, and every funnel chart made in the dashboard is listed here.
Saving a funnel
curl -X POST https://api.actuallytracking.com/manage/projects/YOUR_PROJECT_ID/funnels \
-H "actuallytracking-client-id: YOUR_CLIENT_ID" \
-H "actuallytracking-client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"name": "Pricing to signup",
"steps": [
{ "path": "/pricing" },
{ "event": "signup", "displayName": "Signed up" }
],
"windowHours": 24,
"countBy": "visitor"
}'| Field | Required | Description |
|---|---|---|
name | Yes | The funnel's name |
steps | Yes | 2 to 10 steps, in order. Each is either event (an event name, such as signup) or path (a page, such as /pricing) |
steps[].match | No | How path is compared: is (default), contains, startsWith, endsWith or regex |
steps[].displayName | No | The step's label |
steps[].filters | No | Property filters on the step, such as { "name": "properties.plan", "operator": "is", "value": ["pro"] } |
windowHours | No | Hours to go from the first step to the last, 1 to 720. Default 24 |
countBy | No | session (default): a session has to complete the steps. visitor: a visitor can complete them over several visits |
range | No | The period the funnel covers, such as 7d, 30d (default) or 6m |
dashboardId | No | The dashboard to put it on. Without one it goes on a "Funnels" dashboard, made the first time |
A page step is saved as a pageview (screen_view) with a path filter, and is listed back that way.
PATCH takes the same fields, all optional. steps, when given, replaces every step.
Running a funnel
curl "https://api.actuallytracking.com/insights/YOUR_PROJECT_ID/funnels/FUNNEL_ID?range=7d" \
-H "actuallytracking-client-id: YOUR_CLIENT_ID" \
-H "actuallytracking-client-secret: YOUR_CLIENT_SECRET"Without range or startDate and endDate, it runs over the funnel's own range. data[0].steps holds each step's count, its percent of the first step, dropoffCount and dropoffPercent to the next step, and the revenue (in cents) of the visitors who reached it. totalSessions is how many started.
For full request and response schemas, see the API Reference.