๐Ÿก Remote jobs ๐Ÿ’ผ Companies โ˜•๏ธ News ๐Ÿš€ Build startups New ๐Ÿ“ฌ Newsletter ๐Ÿ“ Blog ๐Ÿ™ Cities ๐ŸŒŽ Countries ๐ŸŽ™ Interviews ๐Ÿ›  Tools ๐Ÿงญ Explore ๐Ÿ“Š Statistics โœ๏ธ Stories ๐Ÿ‘‹ About
Founder

I started to track my newsletter stats

I started to track my newsletters to see how many people are reading them. Iโ€™ve also published live newsletter stats for everyone to see.

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.

Related Founder Articles