View as Markdown
Mixpanel icon

Mixpanel ACTION

Track Event

Send a single event to Mixpanel, attributing it to a user. To query analytics (event counts, funnels, retention, user profiles), connect the separate Mixpanel (Service Account) app, since Mixpanel's query APIs do not accept a project token. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Mixpanel account once, then configure and run Track Event 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: "mixpanel-emit-event-to",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mixpanel: { authProvisionId: "apn_xxxxxxx" },
    event_name: "Event Name",
    distinct_id: "Distinct ID",
  },
})

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.

Track Event inputs
Property Type Description
event_name Event Name string
The name of the event, for example Sign Up, Button Click, or Item Purchased. Event names are case-sensitive, and reusing an existing name is what groups events together in reports.
Required
distinct_id Distinct ID string
The Mixpanel distinct_id of the user who performed the event, for example user_123. Use the same stable identifier you send with your other Mixpanel events so that repeat events attribute to the same profile.
Required
properties Properties object
Additional properties to attach to the event, describing either the user or the event itself. Example: {"plan": "pro", "source": "onboarding"}.
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
mixpanel-emit-event-to
Version
0.4.0
App
Mixpanel
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes