Querying Custom Events Via Mixpanel API

  • 30 July 2019
  • 1 reply
  • 358 views

Userlevel 6
Badge +4

Each week, Mixpanel will release articles from our archives to help you get the most out of Mixpanel. Follow the Topic Tag #fromthearchive to subscribe to these posts and get alerted when they drop.


To query for custom events via any formatted Mixpanel API endpoint, find the stored name of that custom event. When a custom event is created, Mixpanel creates a new object for the event. You can find the exact name of your custom event via the XHR section of your browser’s developer console and copy the name into your query.

  1. Go to Insights, and select your custom event in the your events dropdown.

  2. Open your browser’s developer console (for Google Chrome, Option + Command + j on a Mac; Ctrl + Shift + j on a PC).

  3. Grab the $custom_event: value:

2016-06-01_18_45_06.392034-custom_event_name.png

Then, pass that $custom_event in as the value of the event parameter in your request.

This is a useful tip for when using Mixpanel with Geckoboard, whose Top Event Property List widget will show only native events (not custom events) by default.

Note that custom events may only be used within Mixpanel’s formatted API endpoints and not the raw event export API.




1 reply

@stephanie Any pointers on using the $custom_event in the value of the event parameter?

I’m struggling with actually using the custom event id I found in a query as the “value of the event parameter” (passing it in). Selectors use properties of the event and the ‘name’ property requires a string.  Thanks.

Reply