paint-brush
How to Track Email Effectiveness in Mixpanel Analytics w/Latenode.comby@latenode
929 reads
929 reads

How to Track Email Effectiveness in Mixpanel Analytics w/Latenode.com

tldt arrow

Too Long; Didn't Read

Mailgun.com is a popular email delivery service used by thousands of projects but lacks advanced analytics capabilities. To gain deeper insights into your client's behavior, consider using a tool like Mixpanel.com. With Latenode's simple cloud automation, you can easily track the delivery and open rates of emails sent to each specific user.
featured image - How to Track Email Effectiveness in Mixpanel Analytics w/Latenode.com
Latenode | low-code platform HackerNoon profile picture

Mailgun.com is a popular email delivery service used by thousands of projects but lacks advanced analytics capabilities. To gain deeper insights into your client's behavior, consider using a tool like Mixpanel.com. Tracking email effectiveness can be challenging.


With Latenode's simple cloud workflow automation, you can easily track the delivery and open rates of emails sent to each specific user on your platform. By measuring email campaigns' success and identifying improvement opportunities, you can enhance your clients' experience and boost engagement with your product.

Mixpanel analytics for your Email campaigns integration with Latenode.com


Create two workflows in Latenode.com

To listen webhook calls from Mailgun.com on Delivery and Open events in latenode.com, you must set up receiving webhooks. Simply click the 'Add New Scenario' button and add the 'HTTP -> Triggers -> Webhook' node to your workflow.


Latenode.com UI, create webhook

Congratulations! You now have everything you need to integrate Mailgun.com with your workflow in Latenode. To complete the setup, copy the Webhook URL in your Latenode scenario.

Copy your webhook URL

To set up webhooks in Mailgun.com, follow these simple steps:

To complete the integration, you must set up webhooks for delivery and open events on Mailgun.com. Here's how you can do it:

  1. Log in to your Mailgun account and navigate the 'Webhooks' tab.
  2. Click the 'Add Webhook' button.
  3. Enter the Webhook URL from your Latenode scenario in the 'URL' field.
  4. In the 'Events' section, select 'Delivered' and 'Opened' from the drop-down menu.
  5. Click 'Save' to apply the changes.


That's it! Mailgun.com will now send webhook calls to your Latenode scenario whenever an email is delivered or opened.




Check incoming data in Latenode

After taking the previous steps, you will start to get data about Delivery and Open events direct in the Latenode workflow:


API debug in Latenode.com


Let’s prepare the data for sending to Mixpanel

Before sending the data to Mixpanel, you must transform it to match the Mixpanel API documentation. To do this, you can use a JS node in your workflow.


Here's how:

  1. Open your Latenode scenario in the workflow editor.

  2. Add a JS node to the scenario.

  3. Click on the JS node to open the JS editor.

  4. Enter the code to transform the incoming data as per the Mixpanel API documentation .

  5. Click 'Save' to apply the changes.


That's it! Your data is ready to be sent to Mixpanel for analysis and insights.


The final code for data transform the Email Delivered event:

let result = [];

let timestamp = Date.now();

let distinct_id = data["{{1.body.`event-data`.`user-variables`.`email_location`}}"] + "_" + data["{{1.body.`event-data`.`user-variables`.`email_to_id`}}"];

let insert_id_hash = data["{{1.body.`event-data`.id}}"];

result.push({

       "event": "Email delivered",

       "properties": {

           "time": timestamp,

           "distinct_id": distinct_id,

           "$insert_id": insert_id_hash

           }

   });

return {

   result

}


Now let’s send data to Mixpanel

Add “HTTP -> HTTP request” node and setup it up as follows

Send HTTP request to Mixpanel API with Latenode.com workflows


Great, you have successfully integrated Mixpanel analytics with emails sent from Mailgun using Latenode's no-code automation platform. Now you can track your users' email engagement and behavior more effectively and use the insights to improve your service.


With the workflow set up, you can create reports and dashboards in Mixpanel to better understand how your users interact with your service. This can help optimize your email campaigns, improve user engagement, and ultimately grow your business.



The lead image for this article was generated by HackerNoon's AI Image Generator via the prompt "an email icon on a laptop screen".