# Optimal Send Time

Optimal Send Time is an algorithm that determines the best hour for optimal engagement activity — when each individual member of your audience is most likely to receive and act on your message.

Take the guesswork out of scheduling messages and let Airship's
predictive models optimize send times for you.

Send time predictions update weekly and are exposed as [Tags](https://www.airship.com/docs/reference/glossary/#tag) for [segmentation](https://www.airship.com/docs/guides/audience/segmentation/segmentation/) and analysis in [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa), and exposed as Tag Change events in [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds).

> **Note:** Optimal Send Time is available for iOS, Android, and Fire OS only.


## The Optimal Send Time model

Optimal send time is determined from recent engagement history. To start, app opens are localized to
the user's time zone and aggregated to the hour over the last 60 days of app activity. The best hour
is determined by striking a balance between the user's engagement patterns and a generalized model
of engagement patterns across the app audience. The model also outputs a general best hour, which
is applied to dormant or low-activity users. The general best hour aggregates opens across app users
and selects the best hour based on more frequent opening time for each app platform.

The determined best hour will occur within a three-day window around your selected delivery date. For example, if you choose February 2, the message will be delivered between February 1 and 3.

After enabling the feature, Airship runs the predictive model for your
iOS, Android, and Fire OS audience members, and you can start using the Optimal Send Time model for delivery.

## Optimal Send Time use cases

Schedule notifications without having to guess the optimal time for user engagement. By delivering a message to your users at the best time for them, you can optimize for a higher open rate.

* Send an important update to all users at the time they are most likely to read your message.
* Deliver a coupon to your users at a time when they are most likely to engage.
* Send a long form story to you readers at the best time for them.
* Distribute user engagement across the day to meter traffic flow to the app.
* Compare performance between regular scheduled messages and messages sent using Optimal Send Time.
* Analyze Optimal Send Time user level distribution across hours of the day.
* Analyze correlation between churn risk and user’s best send time.

## Optimal Send Time data and analytics

The Optimal Send Time dashboard in Performance Analytics provides a deeper look into the best time model, including a distribution of best hours across your audience, and the generalized best hour for your audience by platform and day of week.

You can also use Real-Time Data Streaming to observe changes in optimal send time as `TAG_CHANGE` events for the `ua_send_time_prediction` tag group.

## Enable Optimal Send Time

<p>First you must enable Optimal Send Time in the dashboard. Send time prediction supports your production projects only and updates weekly on Wednesdays.</p>
<ol>
<li>Next to your project name, select the dropdown menu (
), then <strong>Settings</strong>.</li>
<li>Under <strong>Project settings</strong>, select <strong>Predictive AI</strong>.</li>
<li>Enable <strong>Optimal Send Time</strong>.</li>
</ol>

## Schedule a message using Optimal Send Time

<p>You can use Optimal Send Time in the Message and A/B Test composers. In the <em>Delivery</em> step:</p>
<ol>
<li>Select <em>Optimize</em> and enter a date.</li>
</ol>
<p><strong>OR</strong> <em>(Message composer only)</em></p>
<ol>
<li>Select <em>Recurring</em>.</li>
<li>Specify the delivery interval by number of hours/days/weeks/months/years.</li>
<li>Set the date for the initial delivery. This is the first time that Airship will send your message.</li>
<li>Select <em>Optimal time</em>.</li>
</ol>

<p>Airship recommends scheduling your message at least three days in advance due to the combination
of time zones and optimal times. You can reduce the lead time if your audience is more localized, e.g.,
only in the United States or in a certain European region.</p>

> **Note:** When your audience includes users without an optimal send time tag, those users will be dropped from delivery and will not receive the message. Since optimal send time is determined from user behavior over time, new users might not have an optimal send time determined for the first week or two after channel registration.

## Schedule `best_time` messages using the API

<p>In the API, Optimal Send Time is represented as the <code>best time</code> key. To deliver notifications at your users’ optimal times via the API, schedule your message using <code>best_time</code>.</p>
<p>The following example shows two schedules for an upcoming message. The first schedule uses a specific <code>scheduled_time</code> for users with the &ldquo;earlyBirds&rdquo; tag, and the second schedule lets the model decide when to send the message, based on the <code>best_time</code> for users with the &ldquo;normalPeople&rdquo; tag.</p>
```http
POST /api/schedules HTTP/1.1
Authorization: Basic <master authorization string>
Content-Type: application/json
Accept: application/vnd.urbanairship+json; version=3

[
	{
		"name": "Morning People",
		"schedule": {
			"scheduled_time": "2018-06-03T09:15:00"
		},
		"push": {
			"audience": {
				"tag": "earlyBirds"
			},
			"notification": {
				"alert": "Good Day Sunshine"
			},
			"device_types": [
				"ios",
				"android",
				"sms",
				"web"
			]
		}
	},
	{
		"name": "Everybody Else",
		"schedule": {
			"best_time": {
				"send_date": "2018-06-03"
			}
		},
		"push": {
			"audience": {
				"tag": "normalPeople"
			},
			"notification": {
				"alert": "Stay Up Late"
			},
			"device_types": [
				"ios",
				"android",
				"sms",
				"web"
			]
		}
	}
]
```

## Look up a user's Optimal Send Time

You can look up optimal send time for an individual user from the dashboard. See also: [Contact management](https://www.airship.com/docs/guides/audience/contact-management/).

1. Go to *Audience » Contact Management*.

1. Enter a [Channel ID](https://www.airship.com/docs/reference/glossary/#channel_id), [Named User ID](https://www.airship.com/docs/reference/glossary/#named_user), or [Device Token](https://www.airship.com/docs/reference/glossary/#device_token). 

1. Click a result to view the named user ID or channel ID page, then click the channel ID and go to the *Tag Groups* tab. The hour tag is listed in the UA_SEND_TIME_PREDICTION tag group.

In the API, the `ua_send_time_prediction` tag group represents Optimal Send Time. You can look up a channel or named user and check the `ua_send_time_prediction` tag group to find the optimal send time for a user. See [Channel Lookup](https://www.airship.com/docs/developer/rest-api/ua/operations/channels/#getchannel) and [Named User Listing or Lookup](https://www.airship.com/docs/developer/rest-api/ua/operations/named-users/#getnameduser) in our API documentation.


## Observe Optimal Send Time in Performance Analytics

The Optimal Send Time dashboard in Performance Analytics provides a deeper look into the best time model, including a distribution of best hours across your audience, and the generalized best hour for your audience by platform and day of week.

Go to the Optimal Send Time dashboard:

1. Go to *Reports » Performance Analytics*.
1. Go to *Spaces » Shared » Predictive* and select *Optimal Send Time*.

## Optimal Send Time events

The `ua_send_time_prediction` tag group contains the send time prediction for each channel. Changes in a user's `ua_send_time_prediction` tag appear as Tag Change Events in the event stream.
