Announcing the Mixpanel Mandrill Connector by Finc3

Mixpanel is an analytics platform that lets you access detailed data from your website or app, focusing on actions your users take, rather than only showing page views. This means you get powerful data you can manipulate and analyze to get a better understanding of how your users interact with your application or website. Then, you can leverage all of that data and set up sophisticated segments to target your users based on their unique behavior.

Now, thanks to the Finc3 Mixpanel Mandrill Connector, you can easily connect Mixpanel and Mandrill to take advantage of Mandrill's trusted delivery infrastructure and send trackable, templated emails based on relevant user actions.

Mixpanel Mandrill Connector Flow

Before You Start

The setup process is simple, but before you start, you'll need the following accounts:

Once you've set up each of those accounts, head over to Finc3's GitHub repository to download the code you'll need to connect each of the different services. You'll also need to make sure that your app or website is set up to send user events to your Mixpanel account. Fortunately, that's as simple as adding a snippet of extra code to your project. Take a look at Mixpanel's integration guide for complete information on passing user data and events to your Mixpanel account.

Get Started

The Parse integration works by configuring endpoints in your Parse project to receive information from Mixpanel's webhooks that you'll set up in your Mixpanel account (not to be confused with Mandrill webhooks). Also note that when setting up your Mixpanel webhooks, do not use the "Test Webhook" feature. This will pass batches of your live data from your Mixpanel account and trigger live emails to your users!

Get the Data You Want

Mixpanel offers the flexibility to track what makes the most sense for your business based on metrics you provide from your app or website.

Once you've added the Mixpanel JavaScript library to your site, you're ready to start passing user data. With a few extra lines of JavaScript, you can quickly start passing any user properties to Mixpanel that you need. So, let's say you have a few levels of subscribers (free, paid) and you want to send a special deal using one of your Mandrill templates within a day from when the user upgrades to a paid subscription. You could do this with a few lines of JavaScript, for example:

Mixpanel JavaScript Snippet

Then, Mixpanel will record the $subscription and $paid_date values to your account so you can use them to trigger webhook notifications.

Mixpanel User Attributes

Trigger Notifications in Mixpanel

By adding the $subscription and $paid_date properties in your site's source code like we show in the JavaScript example in the previous section, you can use that information to trigger a notification in Mixpanel. To create a new notification, give your Mixpanel webhook a name and point it to your Parse project endpoint:

Parse Webhook

Which would then be referenced in your Mixpanel webhook configuration:

Mixpanel Webhook

Next, choose the users you want to target. In this case, you're looking for paid subscribers whose paid date was less than one day ago.

Target users in Mixpanel

Then choose how soon to trigger those emails (ASAP or on a daily/weekly basis).

Mixpanel trigger timing

Then you're all set! Now you can head over to Mandrill to track those emails.

Track Your Success

Ok, so you're sending professional event-based emails. Now what? It's time to see how those emails are doing. Head over to your Mandrill account and start tracking the results.

Pro Tips

Create a new API key! Anytime you're connecting your Mandrill account to a new tool, we suggest using a unique API key. Using a unique API key means you can quickly determine the source of sends through your Mandrill account and even disable the key if something goes wrong (for example, if you accidentally share your API key publicly). Another advantage of unique API keys is that you can use other Mandrill features based on that key. For example, you can use Mandrill's Rule Engine to apply tags or even route messages to subaccounts based on a unique API key.

Test

Ok, so you've got a bit of automation set up, now make sure you're making the most of it. Mandrill's Split Tests provide an automated way for you to try out different email content and compare the results. You can set up your first test in your Mandrill Account on the Split Tests page.

Note: Event triggered emails are great and can provide timely, relevant info to your users, but make sure you're providing users a way to opt-out of those messages.

This is just one simple example of how you can use Mandrill to create and track automations from your Mixpanel data. Feel free to share your own examples of how you're using this integration.