View as Markdown
Amplitude icon

Amplitude ACTION

Get Funnel Analysis

Compute conversion rates across an ordered (or unordered/sequential) set of funnel steps over a date range from the Amplitude Dashboard REST API. Provide one event definition per funnel step. Example: call with events=["{\"event_type\":\"Sign Up\"}","{\"event_type\":\"Purchase\"}"], startDate="20240706", endDate="20240805" -> returns {data: [{stepByStep: [...], cumulative: [...], eventCount: 4200}, ...]} (one entry per step). See the documentation.
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Amplitude account once, then configure and run Get Funnel Analysis from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "amplitude-get-funnel-analysis",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    amplitude: { authProvisionId: "apn_xxxxxxx" },
    events: ["Events"],
    startDate: "Start Date",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Get Funnel Analysis inputs
Property Type Description
events Events string[]
Array of JSON-encoded event definitions, one per funnel step, in order (each becomes a repeated e param). Example: ["{\"event_type\":\"Sign Up\"}","{\"event_type\":\"Purchase\"}"].
Required
startDate Start Date string
Start date, inclusive, in YYYYMMDD format (the start param). Example: 20240706.
Required
endDate End Date string
End date, inclusive, in YYYYMMDD format (the end param). Example: 20240805.
Required
mode Mode string
Funnel step ordering (the mode param). One of ordered, unordered, sequential. Defaults to ordered.
Optional
newOrActive New or Active string
Restrict to new or active users (the n param).
Optional
interval Interval integer
Time interval (the i param). One of -300000 (realtime), -3600000 (hourly), 1 (daily), 7 (weekly), 30 (monthly).
Optional
segmentDefinitions Segment Definitions string
JSON-encoded array of segment definitions (the s param). Example: [{"prop":"country","op":"is","values":["US"]}].
Optional
groupBy Group By string
A single property name to group results by (the g param). Funnels support at most one group-by.
Optional
conversionWindowSeconds Conversion Window (seconds) integer
Conversion window in seconds (the cs param). Defaults to 2592000 (30 days).
Optional
limit Limit integer
Maximum number of grouped values to return (the limit param). Min 1, max 1000. Defaults to 100. Amplitude has no cursor for this endpoint — values beyond this cap are silently dropped by the API, not just this tool. If more than limit distinct group-by values may exist, raise this toward 1000 or narrow with Segment Definitions/Group By.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
amplitude-get-funnel-analysis
Version
0.0.2
App
Amplitude
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes