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
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.
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.
To complete the integration, you must set up webhooks for delivery and open events on Mailgun.com. Here's how you can do it:
That's it! Mailgun.com will now send webhook calls to your Latenode scenario whenever an email is delivered or opened.
After taking the previous steps, you will start to get data about Delivery and Open events direct in the Latenode workflow:
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:
Open your Latenode scenario in the workflow editor.
Add a JS node to the scenario.
Click on the JS node to open the JS editor.
Enter the code to transform the incoming data as per the
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
}
Add “HTTP -> HTTP request” node and setup it up as follows
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".