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

Troubleshooting issues with click tracking

Article Preview

    Overview

    In hopes of tracking your sending engagement, you've enabled click tracking. However, the click tracking links, for some reason, will not resolve. Not to worry - we have a few common troubleshooting tips to help get your links up and running.

     

    Checking the CNAME

    The first step we recommend is to make sure you have the CNAME record for the sending domain properly configured. The tracking hostname should return mailgun.org for the US region, or eu.mailgun.org for the EU region. This can be easily checked in a terminal using a dig command (Linux/Mac) or an nslookup command (Windows). If the terminal scares you, you can always use a web-based tool like MX Toolbox

    Note: The CNAME will not return if you've configured the CNAME as proxy/CDN, such as CloudFlare.

    Dig: 

    $ dig -t CNAME email.domain.tld +short

    Nslookup: 

    nslookup -q=CNAME email.domain.tld

    You should receive the response "Mailgun Magnificent API" if you make an HTTP request to the base tracking hostname, like below: 

    $ curl -s http://email.domain.tld
    Mailgun Magnificent API

     

    Checking HSTS

    Mailgun currently only supports HTTPS tracking links via the use of a configured CDN; more information on that in this article. The source of your issue might be a combination of this element of our system with your settings relevant to HSTS. HSTS tells browsers to enforce HTTPS connections to the domain.  This will result in the tracking links timing out.  The following curl request will quickly confirm if HSTS is enabled: 

    $ curl -s -D- https://domain.tld/ | grep -i Strict
    strict-transport-security: max-age=2592000; includeSubDomains; preload

    You'll need to disable HSTS or use a different domain without HSTS for the tracking links to resolve. If you are unable to disable HSTS, or your use case requires HTTPS, you can check out the help article detailing the steps needed to enable HTTPS tracking links via the link above. 

     

    Checking the original links

    Another element to check is verifying the original links are valid. The best way to do this is to grab the original MIME via either the API or the control panel, providing the message is less than 3 days old (the amount of time our system retains message bodies). 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 Logs suboption.
    4. Ensure that the domain in question 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 search box, enter the Message-ID value.
    6. If results are returned, find the row containing the details of the message in question and click the downward-pointing iconScreen_Shot_2019-12-27_at_2.54.25_PM.png
    7. Select the MIME option to view the full MIME.

    Once you've obtained the MIME, you can inspect the links to see how they looked before they were rewritten to ensure the original links are valid.

     

    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!