Post an Event to Mixpanel

Last Updated -

Introduction: Post an event to Mixpanel using Desk.com

The Desk.com Mixpanel App allows you to send information to Mixpanel to track that an action occurred - you might use this to record that the customer contacted customer service, or perhaps that you need to take another action in a workflow elsewhere in your app.
 

Setup

Getting started with your Desk.com App to trigger a Mixpanel message requires a Mixpanel account. To start Go to yourdesksite.desk.com/admin/apps, click the Mixpanel button (you'll see an image like the one below) and agree to the Terms of Service.
 
 
If you don't already have a Mixpanel account you can set one up at Mixpanel.com.
 

Accounts

A Desk.com App Account is the name you'll use to refer to this Custom Account when you use it in Actions and Rules.
 
You'll need to set a name for this account and add an API key from your existing Mixpanel Account.

Now, we'll configure Desk.com to record actions in Mixpanel using your Mixpanel account. Note: You'll need to tell Mixpanel what to do when you record the action - you make this configuration in Mixpanel itself.)
 

Actions

An Action is the actual message you'll be configuring to send through Desk.com to your Mixpanel Account when a Rule fires that matches the conditions you set.
 
An example of an action is the following, which will let Mixpanel know when a customer creates a case in Desk - you can also add Liquid variables (like {{case.id}}) to provide dynamic information about the current case:
 
 
When fired, this Action will use the Mixpanel App to record an event in Mixpanel and store the message that a particular Desk.com case is updated. To trigger this action, we'll need to attach it to a rule in Desk.com.
 

Rules

Business rules in Desk.com allow you to act without Agent intervention when certain conditions occur at Events specified for a case.
 
Here's an example rule, run on a "Case Created" event, that will post a Mixpanel event that the case has been created:
 
 
A Business Rule fires when a Certain Event occurs (e.g. a Case is Updated) and the conditions specified for that case evaluate to be true. In our example, when a case is created, we'll fire the rule to post the Case Created event to Mixpanel.
 
In addition, this rule will run at any time (not just during Business Hours). (You can use the Advanced Edit to make sure your rule is enabled, and you can also view this rule in the Admin > Case Management > Rules section of Desk.com's Admin.)
 

What happens when everything works?

When you create a case in Desk.com, the Rule will evaluate to be true, and the Action will fire to record an action in Mixpanel using your Mixpanel account.