How to use the mixpanel.Client function in mixpanel

To help you get started, we’ve selected a few mixpanel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mixpanel / mixpanel-node / example / simple.js View on Github external
var mixpanel = require('mixpanel');

var mp_client = new mixpanel.Client('89c4df475859a3323fd9f72237ed7260');

mp_client.track("my event", {
	distinct_id: "1111",
	as: "many",
	properties: "as",
	you: "want"
}, function(err) {
    console.log("sent event");
	if(err) { throw err; }
});

// manual funnel tracking is supported, but not recommended
mp_client.track_funnel("my funnel", 1, "first goal", {
	distinct_id: "1111"
}, function(err) {
    console.log("sent first funnel event");

mixpanel

A simple server-side API for mixpanel

MIT
Latest version published 8 months ago

Package Health Score

70 / 100
Full package analysis