Introduction
Notifications are triggered using Recipes. Recipes are a simple way of attaching a notification to a real user behavior. They can help you reduce the amount of poorly timed notifications you send and ensure that your users are getting value from each communication.
Recipes are authored in the developer dashboard and then sent to the user device to be discovered and acted upon. They make use of the same functionality as the Context APIs but are written remotely instead of in your app code.
Currently, we only support Recipes as triggers for notifications. We’ll be adding other integrations and services soon. Get in touch if you are looking for one in particular.
Recipes for Notifications
The process for creating a Recipe is similar to creating a Notification. Click on your client in the Dashboard, then click on “Recipes” in the left sidebar.
After clicking on “Create your first recipe”, you’ll see a JSON editor pre-populated with an example Recipe.
Give your recipe a name. We’ll call this one “Late for work”. See below for all available options.
Recipe Options
See the Recipes Reference.
Recipe Examples
Place Context with Custom Event Context
In this example, we combine a place-based and Custom Event triggered Context.
In this case, the developer wants to let the user know about some cool suggestions they have for cafes near them that are popular on the weekends. To make that suggestion, the developer wants to be sure that the user is thinking about coffee and that they can get value from the suggestion.
We'll send an engagement to a user that has specifically opened a view in our app that we track with the id
of opened-cafe-view
. We attach it to this behavior so that we are sure the user can get value from the notification we want to send. We limit our notification to within 30 minutes (1800 seconds) of the Custom Event happening.
We also attach Context Options of, weekend, morning, and onWifi.
Finally, just for the demonstration, we'll delay our notification to 5 minutes (300 seconds) after the Context is observed.
{
"context": {
"arrivedAt": {
"type": "any"
},
"tracked": {
"event": "opened-cafe-view",
"conditions": [
{
"equalToCount": 2,
"inPastInterval": 1800
}
]
},
"onWifi": true,
"weekend": true,
"morning": true
},
"delay": 300,
"name": "Coffee drinkers",
"type": "all"
}
Custom Location Event
In this example, we combine a Context trigger that uses a specific location.
Here, our example developer wants to let the user know of some great opportunity they have, but only at a specific location, say a store or a sports field.
We also attach Context Options of atPlace
with our place specified with a [Latitude, Longitude]
.
{
"context": {
"arrivedAt": {
"type": {
"location": [-122.3897449, 37.7783658]
}
}
},
"name": "At the Ballgame",
"type": "all"
}
Context with Custom Event 2
Here, let's let the user know we have some new episodes for them just as they start their morning commute.
You can use departedFrom
or you can use a onTrip
. If your app has Background Location enabled, you can be more specific using onTrip
and specifying a target behavior type (e.g. walking versus driving). We can also help you predict the duration of the trip so you can tailor what content you make available.
{
"context": {
"departedFrom": {
"type": "home"
},
"weekend": false,
"morning": true
},
"name": "Morning commute",
"type": "all"
}
Configure a Recipe to Trigger a Notification
When you link a Recipe to a Notification, the Notification will be sent whenever the Recipe is matched on a per-user basis. You can assign multiple Recipes to a Notification, and you can have multiple Notifications linked to one Recipe.
Navigate to a Notification. Choose a Recipe from the dropdown list under “Recipes” under “Triggers”. Click “Add Recipe”. You’re done!
Deleting a Notification
Simply open the Notificaton in your Dashboard and click Delete in the upper right-hand corner.
[success] You're off to the races!
You've come so far, but don't stop now. Learn how to make use of Self-Tuning Recipes for Notifications in your app.
Get in touch
- If you need help, shoot us a message at [email protected] or ping us on our Slack community.
- If found a bug, or have a feature request, add an Issue on the SetSDK Repo.
- Follow us on Twitter for product updates: @everyset