How to track links inside Mixpanel email notifications?

e.g. helps to check which emails have better CTRs or send additional reminders to people who click.

Note: I originally wrote this in 2015 and it got published in the Mixpanel blog. Then I realized this only work for “distinct ids” that are multiples of 3 digits. Since Mixpanel hasn’t created a feature for this yet, we are still using this tactic. Therefore, I thought, it can still be useful for other companies as well. So I’m republishing it:

If you’re using Mixpanel to send email notifications, then you’re probably wondering how to track which variation of the emails have more click through rates. Or you might want to send additional offers, notifications, reminders, to the people who have clicked the link inside the emails.

This call means, that when Sasha, with distinct_id: 247, clicks on our link inside the email notification, an event will be sent to mixpanel with name: “Clicked Trip Email” & property name: “Where” property value “Image”. (I have two different links in the email, one of them is an image, and the other one is a link. I want to know if the user clicked on either of them, and if so, which one was clicked.)Token is mandatory which can be found inside your account settings in Mixpanel.

2. Convert to Base 64

2a) Base64 of Your Distinct ID

First I try to figure out what is the Base64 equivalent to my distinct id. I’ll tell you why later.

For example, as you can see the Base64 equivalent to my distinct id (247) is MJQ3

2b) Base64 of the whole JSON

Now let’s find out what is the Base64 encoding of the whole JSON that you wrote in part 1.

2c) Find the “Right” Base64

I do a quick search (CTRL+F or Command+F) to see if I can find my Base64 equivalent of my distinct_id which is MJQ3 in the final BASE64 Encoding from the last. If yes, hallelujah! If no, try deleting couple of the “spaces” whithin the JSON and encoding it again. It should work after some tries.

6. Embed link onto your email

Now I embed this link in any text or image inside my Mixpanel Email Notification.

7. Create Base64 ID People Property

Before you turn on the email notification, you need to add a people property to each user, which includes the Base64 encoding of the users’ distinct_id. Property name: {{${Base64 Id}}} & property value.

Every programming language has it’s own internal function that can convert a string to Base64, just consult with your backend developer.