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.

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.

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

How we processed 12 trillion rows during Black Friday
A privacy-first approach to building a Google Analytics alternative
Changelog: BigQuery connector, CLI improvements, Pagination on endpoints and more

Tinybird

Team

Mar 04, 2021
More Data, More Apps: Improving data ingestion in Tinybird
Changelog: Snowflake connector, cancellable jobs and more

Tinybird

Team

Mar 23, 2021
Low-code analytics with James Devonport of UserLoop

Tinybird

Team

May 05, 2023
How We Handle Technical Incidents and Service Disruptions
Modern data management with real-time Change Data Capture
You can now explore and analyze time series data in Tinybird
Tinybird at South Summit Madrid 2019

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.
Need more? Contact sales for Enterprise support.