How to set up tracking on Ghost Newsletters

Ghost introduced newsletters in Ghost 3.1 using the email service Mailgun.
You can get analytics of your Newsletters with Ghostboard: not only how many emails were sent, delivered, failed, marked as spam but also how many opens, clicks, and unsubscribes.
For tracking opens, clicks, and unsubscribes you need to create a CNAME entry for your domain and activate tracking. Let's see how to set up tracking step by step.
Subdomain constraint 🚨
You should know that tracking by Mailgun requires you to use a subdomain. So you if are already using a subdomain for sending emails, for example, mg.domain.com, the tracking hostname would be tracking.mg.domain.com or similar.
The problem is it's a 2nd level subdomain and this can make it hard the tracking because of SSL certificates and redirects.
And in case you are using Cloudflare (Ghost Pro uses it) you may have to contact Cloudflare to ask to make it works. Source: Mailgun Help (Special Note before steps)
Then the easy setup for tracking with Mailgun would be to use the main domain without subdomains. For example domain.com, and then use a 1st level subdomain for tracking, like example.domain.com
💡 You choose the domain, could be tracking.domain.com, newsletter.domain.com, or whatever you wish
Don't worry too much about this issue about subdomains: you can use several URLs for the same domain. For example, Ghostboard uses one subdomain to send emails via API and another subdomain for Ghost Newsletters.
Also, we recommend doing it this way, because if you use one single domain both for Ghost Newsletters and to send emails programmatically (via API or app), these emails will have changed URLs inside emails and you may not desire this.
What you need to start tracking ✨
After you already have a Mailgun account and you are familiar with the basic Mailgun setup in Ghost (region, domain, and key), let's set up tracking.
CNAME record
- Login to your Mailgun account
- Click on Dashboard on the left menu, the first option

- Below the chart, you will see your domain list, click on Domain Settings of the domain you use for Ghost Newsletters. In our case, the main domain without subdomains.

- Note the Tracking Section, click the Edit button of Tracking hostname. Enter the name of the subdomain. Following the example, here is the newsletter and the CNAME will be newsletter.domain.com

- Now go to the top and click on the 2nd tab called DNS records

- Scroll down to the bottom for the last section called Tracking records

Here you have all the info you need to create a CNAME record on your domain provider. Create a DNS record of type CNAME, with the hostname you see (subdomain.domain.com) and the value you can copy on Mailgun. It's mailgun.org for the US region and eu.mailgun.org for the EU region.
It's time to add the CNAME records into your DNS
💡 You can find good tutorials out there about how to create a CNAME record in <your domain provider>
✅ When you have done it, note it can take a few minutes or hours to be noticed by Mailgun. On the same page of the last screenshot, at the top right corner, you have the button Verify DNS Settings to check if it's ready.
Activate tracking
- You can activate manually the 3 checkboxes on the domain settings > tracking section on Mailgun
- On Ghostboard, anytime click the blue button Open setup and the options are below. Easy!

This way Ghostboard activates or disables them for your automatically. From the moment Mailgun starts tracking, Ghostboard will show you the data from the API on your dashboard.
Write your Ghost blog success 🚀
Give a try to Ghostboard without any risk: start now your 14 days free trial without a credit card, check it out by yourself 🙂
Happy to help you and answer any question, tweet us, or contact us in your dashboard! 👋