We're experiencing difficulty. Our engineers are on it. Please check status.mailgun.com for real-time updates.

Troubleshooting issues with open tracking

Article Preview

    Overview

    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 does it work?

    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 CNAME record for tracking 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

     

    Is tracking actually enabled?

    Tracking can be enabled in 3 different ways:

    1. Global tracking settings are found on the domain details page of the Mailgun control panel. We'll show you how to do this below:

    1. First, log in to the Mailgun Control Panel (if you have not already done so).
    2. Then, within the left-hand navigation pane, click the Sending option to expand its list of suboptions.
    3. Next, click the Domain settings suboption.
    4. Ensure that the domain for which you wish to to view the tracking settings is displayed within the Domain drop-down list towards the upper-right portion of the page.
      Screen Shot 2022-09-11 at 6.58.43 PM.png
    5. In the Tracking section, click the Edit button for the Open tracking option.
    6. Toggle the setting to On and click the Save open tracking settings button.

    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. (Both of these are demonstrated below).

    • 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

     

    Still not receiving open 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. 

     

    Need Support?

    Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support section of your Mailgun Control Panel, and we'll be with you shortly!