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

Send Time Optimization

Article Preview

    Overview

    We’re all unique individuals, with individual habits. Many of us are creatures of habit (myself included) and check our emails at certain times of the day, and this is where STO comes into play. STO is a Mailgun feature that uses machine learning to determine the best time to deliver a message to a recipient. The idea here is that if we can deliver a message right before a recipient typically checks their email, then the message will be towards the top of the inbox and the user will be more likely to engage with it, thus improving your overall engagement rates and ultimately increasing your ROI through increased conversions.

     

    How does STO work?

    Mailgun sends billions of messages a month. Looking at the engagement data over time for these messages allows us to determine individual email engagement habits. When you send a message to a recipient using STO, our algorithm analyzes the data we have on hand for that recipient and calculates the most active time for that recipient. We then schedule that message to target the recipient’s active time.

     

    What kind of results can I expect?

    We've seen an average of 5-10% uplift in opens and clicks across senders using STO. With that said, however, results can vary. Ensuring you have Open and Click tracking enabled with Mailgun will ensure we have more data on hand to analyze and therefore make a more accurate decision. Our algorithm will also get more accurate over time as we collect more open and click engagements from your recipients.

     

    How do I use STO?

    API

    If you’re integrating with Mailgun via a custom app or via a SaaS provider, then you’re likely using our messages API, and you’ll use STO by passing the `o:deliverytime-optimize-period` parameter to the /messages endpoint, along with a “time window” value. 

    The value should be set to the number of hours in `[0-9]+h` format, with the minimum being `24h` and the maximum being `168h` (7 days if the domain has a 7-day retention period). This value defines the time window in which Mailgun will run the optimization algorithm based on prior engagement data of a given recipient. After the optimization the message will be scheduled for the time that is deemed to be optimal for that recipient. (Example: if it’s 12:00PM your time and you want to ensure the message is delivered by the end of the day, then you’d provide a 12h value so that the message is delivered by 12:00AM)

     

    Example:

    HTTP API through cURL:

    curl -s --user 'api:YOUR_API_KEY' \
       https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
       -F from='Excited STO User <mailgun@YOUR_DOMAIN_NAME>' \
       -F to=bar@example.com \
       -F subject='This is an STO message' \
        -F html='This message was sent with STO enabled!' \
      -F o:deliverytime-optimize-period='24h' \

        -F o:tag=’STO_enabled’

    SMTP

    If you’re sending messages through Mailgun using a Front-end or marketing automation platform (Customer.io, Ongage, etc), then you’re likely using SMTP and you’ll need to provide the following custom MIME header and value:

    X-Mailgun-Delivery-Time-Optimize-Period: 24h

    The 24h value provided above represents the time window in which Mailgun will run the optimization algorithm based on prior engagement data of a given recipient. After the optimization the message will be scheduled for the time that is deemed to be optional for maximum user engagement. The value should be set to the number of hours in [0-9]+h format, with the minimum being `1h` and the maximum being `24h`. (Example: if it’s 12:00PM your time and you want to ensure the message is delivered by the end of the day, then you’d provide a 12h value so that the message is delivered by 12:00AM)

     

    Examples:

    SMTP MIME

    X-Mailgun-Delivery-Time-Optimize-Period: 24h
    Date: Tue, 16 Jul 2019 12:56:42 +0000

    Sender: user@email.example.com

    Message-Id: <20190716125642.1.0B7E027813A586BF@email.example.com>

    To: dude@mailgun.com

    From: dude@email.example.com

    Subject: Hello STO

    Mime-Version: 1.0

    Content-Type: multipart/alternative; boundary="c1504c4d127d4527acde74be95afc945"

     

    --c1504c4d127d4527acde74be95afc945

    Content-Type: text/plain; charset="ascii"

    Mime-Version: 1.0

    Content-Transfer-Encoding: 7bit

     

    This should be scheduled to arrive at the best time

     

    --c1504c4d127d4527acde74be95afc945

    Content-Type: text/html; charset="ascii"

    Mime-Version: 1.0

    Content-Transfer-Encoding: 7bit

     

    <html><body>This should be scheduled to arrive at the best time</body></html>

    --c1504c4d127d4527acde74be95afc945--

     

    Testing With STO

    When sending a new variation of your campaigns, it’s always important to A/B test. This is no different with STO. We highly recommend A/B split testing your sends when using STO, if you have the capability. In addition, we recommend using unique tags for each segment, which will allow you to analyze the data once your sends are complete using our Analytics platform. 

    When performing an A/B test, it’s important that you’re using statistically significant data. One of our partners, Customer.io, wrote a great article outlining how to get conclusive results from your A/B test.

     

    Questions & Answers

    Do I have to have Open and Click tracking enabled with Mailgun for this to work?

    STO will work best with Open and Click tracking enabled, however, we do aggregate the data at the Mailgun level, so Open and Click tracking is not required for STO to work.

    What happens if there is no engagement data for a recipient?

    Given the number of messages we send on a regular basis, chances are pretty good that we’ll have some engagement data for your recipients to analyze and make a decision, however, this may not always be the case. If we don’t have any engagement data, or the data is not sufficient to make a confident decision, the message will be delivered at the originally scheduled time (immediately if the message is not scheduled).

    Will this improve my delivery and deliverability rates?

    Short answer: no. Delivery rate is the measure of the number of messages sent vs the number of messages that actually get delivered (and not bounced) to a mailbox (regardless of whether it made it to the inbox or spam/junk folder). Deliverability rate is the measure of the number of messages that were delivered vs the number of messages delivered to the inbox (and not spam/junk). STO will not improve these rates. If you already have high delivery/deliverability rates, what STO should do is improve your engagement rates for messages that are already being delivered to the inbox as they should be more visible to recipients.

    How do I see the scheduled messages that were sent using STO?

    Assuming you tagged the STO message using a unique tag, you can perform a search in the logs for tags: “<tag>” and you’ll see a “scheduled-for”: 1568391126. The scheduled time is displayed in epoch time, which you can translate using an epoch conversion tool like this one. The timestamp in my example (1568391126) translates to Friday, September 13, 2019 11:12:06 AM GMT-05:00 DST.

    What type of messages should I apply STO to?

    STO will work best for marketing messages that you want delivered when the recipients are typically engaged in their mailbox. Typically for transactional messages, you want them delivered immediately, or at a certain time, so we don't recommend using STO for transactional messages.

    Can I use only my own Open and Click data?

    No, not at this time. Our algorithm will analyze data that we’ve accumulated across all senders on our platform. 

    Can I provide an email address and get back the optimal time?

    No, STO will only schedule a message given the data we have on hand. The API will not return any data about the recipient

    Can I turn it on via the control panel?

    Currently, the only way to enable STO is via API parameter or SMTP header per message.

    Can I use STO with a mailing list or batch calls?

    Currently, STO is only available on a per recipient basis.

     

    Need Support?

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