What is Open tracking?
Tracking is an invaluable feature used to gauge user interaction and response to your email campaigns. Ensuring the feature is working as intended is key to obtain accurate statistics for your emails.
How does it work?
Before we get into diagnosing issues with Open tracking, we need to know how tracking actually works. To track Opened events the email must meet the following criteria:
- The sending domain must have the tracking CNAME in place
- The email must contain HTML content
- The recipient must be able to load images in the email
- The domain or email must have tracking enabled
- The email must contain a Tag (optional)
When a message is submitted through Mailgun, an invisible 1x1 pixel image is embedded into the body of the message. This image performs a request to our server, logging the recipient's tracking information in your Domain's logs. Additionally, a Tag may be used to help our system aggregate the statistics for a specific email campaign or service (i.e. sign-up, password resets, billing notifications) within your platform. It is important that the image loads on the recipient's side in order to capture the tracking data.
How do I enable tracking?
Tracking can be enabled in 3 different ways.
- Global tracking settings found in the Domain details page of the Mailgun Control Panel. On this page, click on your domain the scroll down to Tracking Settings. Here toggle the Tracking setting between On and Off. This will enable tracking on all message submitted through this domain.
- NOTE: If the tracking CNAME is not properly configured, the option to edit the Tracking options will not be available. See our DNS troubleshooting guide for assistance.
- Add the Open tracking parameters with your API request or tracking headers to the MIME body is sending via SMTP.
- NOTE: The tracking headers/parameters have precedence over the global domain settings. This is helpful if you wish to only track a specific group of messages.
- Sending via our API
- o:tracking = yes - Enable both Open and Click Tracking
- o:tracking-opens = yes - Only enable Open tracking
- Sending via SMTP
- X-Mailgun-Track: yes - Enable both Open and Click Tracking
- X-Mailgun-Track-Opens = yes - Only enable Open tracking
Tracking is enabled, but I am still not receiving Opened events.
There are 3 main points to review when Open tracking is not resolving.
- The Tracking CNAME is no longer setup correctly or resolving publicly. This can be confirmed via a dig or nslookup query from your computer or a public DNS tool like What's my DNS. If the CNAME hostname does not return the value "mailgun.org", then the record would need to be updated at your DNS hosting provider.
- The email does not contain an HTML body. The tracking image cannot be embedded on a text-only email. To resolve just update your email's template to include HTML content.
- By default, our tracking links do not support forced HTTPS redirects. If your domain forces HTTPS redirects via HSTS or other similar methods, then the tracking link cannot finish the callback to our server. See our article on HTTPS tracking for assistance.
If you are still experiencing any issues after the domain's DNS records are publicly resolving, reach out to your friendly Mailgun support team and we'll help investigate the issue further.