Back
Jan 20, 2025

Building a Resend analytics dashboard

Alasdair Brown
Developer Advocate

Resend is a developer platform for sending transactional and marketing emails. If you don’t do much with email, well done, you’ve won in life. But if you do, Resend is probably going to save you a bunch of headaches.

Once you’re set up to send with Resend, how do you know you’re “doing email right”? Resend captures events about the status of your emails - when it's sent, delivered, bounced, etc. - and offers webhooks so you can push these events elsewhere. Sending these webhooks to Tinybird’s Events API works out of the box, so with a little bit of SQL you can finally know if “Dear Sir/Madam” is a better email intro than “Oi, you”.

The dev stack analytics template contains analytics dashboards for the most popular dev tools, and this week I’ll be working on the Resend dashboard, with a new video each day working through one chart at a time.

What events have we got?

Resend has a bunch of different events you can work with. There’s 3 objects you can get events for: emails, domains and contacts. I’ll start by focusing on emails. That gives you 7 different event types to look at:

  1. email.sent
  2. email.delivered
  3. email.delivery_delayed
  4. email.complained
  5. email.bounced
  6. email.opened
  7. email.clicked

The opened and clicked events depend on embedding a tracking pixel, which is not something I recommend if you want to stay out of Spam, so I’ll pretend they don’t exist.

Just sent, delivered and bounced should cover a vast majority of real world events and give you plenty to work with.

Start building with Tinybird
If you've read this far, you might want to use Tinybird as your analytics backend. Start for free with no time limit.

Getting events

Configuring Resend webhooks to send to Tinybird only takes a minute or two and is covered in the docs. Once configured, you’ll have a Data Source receiving events that looks like this:

If you’re not yet sending production emails, or want to force specific events like bounces, you can send test emails.

Querying events

The Data Source of events is a time ordered append log. The event_type column will let you quickly filter for the specific events. With a Pipe, you can start to query your events in SQL.

A query like this will give you the email.sent events in time order:

Let’s say you want to plot your email sends over time. You don’t need the whole event, just a count that is aggregated by some time granularity that you can plot over time. You can use a query like this:

This will count how many emails are sent per day, giving you a result like:

period

sent

2025-01-18

3456

2025-01-19

4678

2025-01-20

5678

That’s a super simple example, but from there you can start to build out anything you want to see.

Subscribe to our newsletter
Links to our blog and other great reads sent every other Saturday.

Building the dashboard

Over the next week, I’ll be working towards a dashboard that looks like the wireframe below, showing how each query and chart component is built. The code for the whole thing will be available in the dev stack analytics template.

Do you like this post?

Related posts

Improved Support for Replacing or Appending Data
We've improved notifications for ingestion issues
Operational Analytics in Real Time with Tinybird and Retool
How Inbox Zero uses Tinybird for real-time analytics
Changelog: Snowflake connector, cancellable jobs and more

Tinybird

Team

Mar 23, 2021
Using custom Kafka headers for advanced message processing
Use AWS SNS to send data to Tinybird
Changelog #18: High-frequency ingestion, handling NDJSON files and more product enhancements

Tinybird

Team

Feb 01, 2022
A new dashboard for Tinybird Analytics
Simplifying event sourcing with scheduled data snapshots in Tinybird

Build fast data products, faster.

Try Tinybird and bring your data sources together and enable engineers to build with data in minutes. No credit card required, free to get started.