I started to track my newsletter stats

I enjoy reading Product Huntโs daily newsletter โ it highlights whatโs happening in tech through new product launches in a short and fun way (there are gifs).
I thought that it would be cool to have a similarily fun newsletter about remote work and Iโve been occasionally writing this for 6 months now.
Although it started out as a daily letter, itโs now more like weekly. Or actually, I send it every... sometimes. Well okay, Iโve sent 37 newsletter so far.
These newsletters are sent by email (obviously), but they are also visible on my site so that people who are not subscribed can also read them. And itโs good for my search engine rankings too.
But I wanted to know how many people are actually reading these newsletters from their inbox. Iโve been recently working on my Open Startup pages and so Iโve now created a new section for newsletter statistics that shows:
Total newsletter subscribers + new subscribers in 1d and 30d
Average open rate %
Average click rate %
Chart with new subscribers
List of newsletters and how many of them were actually delivered, opened and clicked
Iโve also added live stats to newsletters displayed on RemoteHub, so people who are reading newsletters online can see how many people got the letter, how many of them opened it and how many were clicked on
How I built this?
RemoteHub is built in PHP on Laravel and Iโm using Mailgun to send emails. I set up Mailgun webhooks that notify my API about email deliveries, opens and clicks.
This means that Mailgun notifies me with a HTTP POST request when it detects an email delivery, open or click.
I have a newsletter_mails datatable where I store all newsletter emails that I send. When sending out an email, I store swift_message_id that letโs me later connect events with corresponding emails.
Iโve added delivered_at, opened_at and clicked_at columns to my newsletter_mails table and will fill them whenever event comes in.
And thereโs also a robot (cron script) that sums all deliveries, opens and clicks to store them in my newsletters table for stats
You can see these stats on my /open/newsletter page. At the time of writing, I only have yesterdayโs newsletter numbers that are still increasing, so itโs too soon to make any conclusions. Robot continues to update newsletter stats for a week and then drops it โ I donโt think many people are reading emails from more than week ago.