Send Your First Message

It should only take a couple of minutes to send your first message.

Install the Mixpanel JavaScript library

First, install a Mixpanel tracking library. In this example, we'll be using the JavaScript library, but there are many others (such as iOS and Android) for sending data from other platforms.

To install the library, just paste the following code into the <head> section of your HTML page. Make sure to change YOUR_TOKEN to your actual project token, which you can find by clicking your name in the upper righthand corner of your Mixpanel project and selecting Settings from the dropdown.

Create a profile

Mixpanel allows you to tie data to a specific user, creating a profile. This is where you store things like their email address, where they came from, or their age. When you include contact information, you can start sending targeted messages right from Mixpanel.

In this example, we're going to set up a new email message, so we need to create a profile with the "$email" property. Other types of messages (such as iOS and Android push notifications) require different properties.

mixpanel.identify("13487");
mixpanel.people.set({
    "User name": "JoeDoe1980",
    "$first_name": "Joe",
    "$last_name": "Doe",
    "$email": "joe.doe@example.com"
});

Add your tracking code to the page and refresh to create the profile. 

Look at your report

You must have People data to target messages. Ensure that you have People profiles built by checking the Explore Report.

  Screen_Shot_2018-02-23_at_3.36.37_PM.png

Create a message

1. Mixpanel Messages can be accessed in the "Take Action" dropdown. Select "Messages" from the dropdown. Screen_Shot_2018-02-23_at_3.29.50_PM.png

2. Click "Create Message".

Message_Creation.png

3. Build your email by filling in the fields.

Screen_Shot_2018-02-23_at_3.31.30_PM.pngIt's important to note that you can use profile properties in all of the email fields.

Using profile properties in your email

Our templates will replace content that is wrapped in {{ }}. Here we're using the "User name" property we set before. In this case, we additionally wrap the property name in ${} to escape spaces.

Hey {{ ${User name} }},

Thanks for signing up. Need any help? 

4. When you submit the form, it will ask you to define the targeting criteria for your message.  You can use many combinations of profile properties when you're creating a real message.

Screen_Shot_2018-02-23_at_3.32.33_PM.png

5. Once you've targeted your users, you just have to schedule the email. There are two options for scheduling emails:

  • ASAP messages: These messages go out to individual users as soon as they match the targeting criteria for the first time. It's common for users to go from "not matching" to "matching" – many messages include a time-based requirement such as "last login was greater than two weeks ago", or one based off of other profile properties that may change (Mixpanel will only send the message to a user one time).
  • Scheduled messages: These messages can be set to go out at a specified time, day of week, or interval. For example, you could set your message to go out at 9am PST every Wednesday. When the message runs, it finds all the users who match the criteria you have defined (and who have never received this message) and sends it to them.
Find your answer?
7 out of 17 found this helpful

Comments

0 comments

Article is closed for comments.