Open Tracking is an essential feature used to gauge user interaction with and response to your email campaigns. Ensuring this feature is working as intended is key to obtaining accurate statistics for your emails.
How It Works
Before we get into diagnosing issues that can occur with Open Tracking, we need to know how tracking actually works. To track Open 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 can 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 Mailgun 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.
Tracking can be enabled in 3 different ways:
1. Global tracking settings are found in the domain details page of the Mailgun control panel.
Inside the Mailgun Control Panel (options displayed down the left-hand side on a dark column), use the following instructions:
- Click on Sending on the left of the screen
- Select your domain name
- Click on Domain Settings
- Scroll down to Open tracking, where you'll then click on Edit all the way to the right.
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.
2. Add the Open tracking parameters with an API request; or 3. Add Open tracking headers to the MIME body when 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; 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 any questions arise, just reach out to our Support team via the Support option in your Mailgun control panel!