Powerful, self-serve product analytics to help you convert, engage, and retain more users
Write custom Node.js code and use any of the 400k+ npm packages available. Refer to the Pipedream Node docs to learn more.
Mixpanel is a powerful analytics API that allows you to track, analyze, and
engage with your users. With Mixpanel, you can build a variety of applications
and services, including:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
mixpanel: {
type: "app",
app: "mixpanel",
}
},
async run({steps, $}) {
const data = `data={
"event": "Pipedream test event",
"properties": {
"token": "${this.mixpanel.$auth.token}"
}
}`
return await axios($, {
method: "post",
url: `https://api.mixpanel.com/track#live-event`,
headers: {
"Content-Type": `application/x-www-form-urlencoded`,
},
data,
})
},
})
// To use previous step data, pass the `steps` object to the run() function
export default defineComponent({
async run({ steps, $ }) {
// Return data to use it in future steps
return steps.trigger.event
},
})