Skip to main content

Analyze funnel

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/o?method=funnel

Overview

Calculates funnel progression data for a funnel definition and selected period/filter.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

Requires funnels Read permission.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be funnel.
app_idStringYesTarget app ID.
funnelStringYesFunnel ID.
periodString or JSON String (Array/Object)NoPeriod input for calculation.
filterJSON String (Object)NoQuery filter object.
filter_idStringNoDrill bookmark ID used when filter is not provided.
task_idStringNoExisting task ID to fetch async task result.
end_stepNumberNoStep index used for user-list extraction mode.
users_for_stepNumberNoLegacy alias for end_step; returns user IDs for that step.
users_between_stepsStringNoLegacy format `from
no_cacheBoolean/StringNoSkips cache lookup for this request.
save_reportBoolean/StringNoRuns through long-task/report flow.
echoStringNoEcho value returned in response.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples

/o?
method=funnel&
app_id=64f5c0d8f4f7ac0012ab3456&
funnel=67f1c22912df5acb8f8d5caaf0f89a31&
period=30days
/o?
method=funnel&
app_id=64f5c0d8f4f7ac0012ab3456&
funnel=67f1c22912df5acb8f8d5caaf0f89a31&
period=30days&
filter={"cc":"US","d.ios":true}
/o?
method=funnel&
app_id=64f5c0d8f4f7ac0012ab3456&
funnel=67f1c22912df5acb8f8d5caaf0f89a31&
users_between_steps=0|1

Response

Success Response (Calculated Funnel)

{
"total_users": 1000,
"users_in_first_step": 820,
"success_users": 290,
"success_rate": 29,
"steps": [
{
"step": "Product View",
"query": {},
"users": 820,
"times": 950,
"percent": 82,
"percentLeft": 18,
"percentUserEntered": 100,
"percentLeftUserEntered": 0,
"averageTimeSpend": 0
},
{
"step": "Add to Cart",
"query": {},
"users": 510,
"times": 580,
"percent": 51,
"percentLeft": 31,
"percentUserEntered": 62.2,
"percentLeftUserEntered": 37.8,
"averageTimeSpend": 91
}
],
"echo": "widget-1"
}

Success Response (Async Task Started/Running)

{
"task_id": "67f2d1f37f7d9f0012ab7890"
}

Success Response (User IDs Mode)

["uid1", "uid2", "uid3"]

Response Fields

FieldTypeDescription
total_usersNumberTotal users in analyzed period/user set.
users_in_first_stepNumberUsers who matched step 1.
success_usersNumberUsers who reached final step.
success_rateNumberFinal-step conversion percentage.
stepsArrayStep-by-step funnel metrics.
steps[].stepString or ArrayStep event or grouped step events.
steps[].usersNumberUsers reaching step.
steps[].timesNumberEvent count on step.
steps[].percentNumberPercentage relative to full funnel population.
steps[].averageTimeSpendNumberAverage transition time to next step.
task_idStringAsync task ID when long-task processing is used.

Error Responses

  • 400
{
"result": "Missing request parameter: funnel"
}
  • 400
{
"result": "Requested funnel does not exist"
}
  • 500
{
"result": "There was a problem calculating funnel"
}

Behavior

  • If task_id is provided, endpoint returns parsed stored task output.
  • For active drill-enabled deployments, processing uses task manager and may return task_id.
  • If users_for_step or users_between_steps is requested, response returns user ID list.
  • In normal mode, per-user raw step.data objects are removed before response.
  • If drill storage is unavailable, returns zeroed step structure based on funnel definition.
Implementation details

Configuration Impact

SettingDefaultAffectsUser-visible impact
funnels.funnel_cachingtrueCache read/write behavior for funnel results.Repeated requests can return cached results faster (until cache expires/invalidates).

Database Collections

CollectionUsed forData touched by this endpoint
countly.funnelsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.long_tasksBackground task trackingStores long-task lifecycle records for asynchronous endpoint processing.
countly_drill.drill_eventsDrill event recordsStores granular event rows queried or updated by this endpoint.
countly_drill.drill_bookmarksEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.app_users{appId}Per-app user profilesStores user-level properties and profile fields affected by this endpoint.
countly_fs.funnels_cacheEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.