Mixpanel provides a way to query the data you send to it using something they call JavaScript Query Language (JQL).
To experiment with it, you can navigate to the JQL app for your project:
Which takes you to the JQL editor:
Alternatively, you query Mixpanel’s JQL endpoint directly from a local script:
First, you need to create a file with the JQL. I called mine testing.js
:
Next, grab your project’s API Secret from its settings.
Finally, execute the JQL:
$ curl --silent https://mixpanel.com/api/2.0/jql -u YOUR_API_KEY: --data-urlencode script@testing.js | python -m json.tool
The last part that pipes to python simply formats the JSON response when it’s displayed in the terminal for easy viewing:
This is a trivial example obviously, but there’s a lot more you can do with JQL. You can use JQL to perform any type of analysis that you can in Mixpanel itself, and more.
Impressive how many times I’m looking for a technical answer to something and your blog pops up! This JQL stuff is rough though. :)
I would highly recommend using a tool like Fivetran to get your Mixpanel data into a data warehouse like BigQuery. Then you can query it like a normal SQL table. Here’s an example: https://mattmazur.com/2018/05/11/looker-daily-uniques/
Cause yes, JQL is rough :)