Mobile SDK end-of-life has been announced and scheduled for the end of 2023, in favor of updated and more streamlined app personalization using server-side APIs.
Push notifications automatically send a message to users at a scheduled time or when an event is triggered. For example, you can send a notification to users who left your app without completing a purchase. This enables you to engage your consumers wherever they are with rich, relevant, and compelling content and bring them back to your app.
Note: Rich push notifications require iOS 10 or higher, or Android 4.1 or higher.
Triggers or schedules
Push notifications are sent based on the trigger or schedule you select. The trigger can be an out-of-the-box trigger event or a custom event.
- Schedule
The push notification is sent at a specified time with no visitor behavior required. To enable schedule push notifications, speak to your Technical Account Manager. - Abandoned Cart View (e-commerce only)
A user who adds items to the shopping cart without completing a purchase will receive a push notification that includes the items in the cart and a call to action to complete the purchase. - Abandoned Product View
A user who viewed a product in the last session without completing a purchase will receive a push notification with recently viewed items and a call to action to complete the purchase. - Abandoned Application View (Financial Institutions only)
A user who started filling out an application for a financial product without submitting it will receive a push notification that includes the name of the application's product and a call to action to complete the application process. - Application submission view (Financial Institutions only)
A user who submits an application will receive a push notification including the name of the product and a call to action - Abandoned category view
A user who viewed a category page in the last session without completing a purchase will receive a push notification with relevant content and a call to action to complete the purchase. - Custom event
A user who triggers any event you specify will receive a push notification that you define.
Creating push notifications
- Prerequisite: Enabling Triggered Push Notifications.
- Go to Push Notifications › Add New and select the trigger or schedule type.
- Configure the settings depending on your trigger type. Some of the settings cannot be changed depending on the trigger type you selected.
- Settings for scheduled push notifications:
- Send Notification: Specify the date and time to send the notification, or select Immediately to send the notification as soon as you click Send.
The status remains active until the notification is sent, at which point the status becomes sent and the notification is no longer editable.
- Send Notification: Specify the date and time to send the notification, or select Immediately to send the notification as soon as you click Send.
- Settings for event-based push notifications:
- Trigger: Select your trigger and specify its properties.
- Delay send: The time between the trigger and sending the notification. If the trigger is fired more than once before the message is sent (for example, multiple Add to Cart events), the delay timer is reset after each trigger.
- Cancel send: Set a condition that occurs after the trigger but before the message is sent, to cancel a push notification. For example, you can decide to suspend a cart abandonment message if the user purchases a product.
- Frequency Capping: The max number of messages (of this type) that a user receives within a specific time interval. For example, you can decide to send cart abandonment notifications no more than once a week.
- Settings for scheduled push notifications:
- Click Next to define the targeting settings, as you would for any Experience.
- Define variations based on a template. Save your Experience and then save and publish the push notification to activate it on your app.
Variations for push notifications
Dynamic Yield provides an assortment of templates for push notification variations. In addition, you can configure a custom template using JSON code. Each template has a different set of configurable fields. In some cases, the configuration can be slightly different between iOS and Android templates.
As you edit the variation fields, the preview is updated in real time.
Notes:
- The Tap Action determines what happens when a user taps the push notification. If left empty, the default action is used, which opens your app on the default screen. Alternatively, you can add a deep link to launch your app on a specific screen or together with a specific action.
- Add images by entering the URL of the desired image. A full image is displayed when the push notification is expanded; when collapsed, a thumbnail is displayed.
- You can add up to two action buttons in some templates that appear under the main image.
- The Single Product and Product Slider templates take products from a feed based on a strategy you specify. You can use dynamic attributes in the text fields to refer to product attributes.
- In the Product Slider template, tapping the notification area always activates the tap action for the entire variation content, regardless of the product that is tapped. You can define different deep links for the individual action buttons under the image, as illustrated in the image.
Previewing and simulating push notifications
To view a preview of a push notification on your device, click the preview icon next to the desired variation when creating or editing a push notification. Follow the on-screen instructions and select your device.
Simulations can also be performed that allow you to test the trigger and view the full notification workflow. Use the Simulation button from the Push Notifications page.
If the strategy and filters you set do not result in items from your feed, the push notification is not sent. In this case, neither the preview nor the simulation work.
Troubleshooting push notifications
If you are not receiving push notifications, and have configured them according to the procedures outlined here, use these steps to try to resolve the issue.
- Make sure that you have enabled push notifications.
- Disable other push notification providers on the app.
- Check the device logs to verify that an opt-in message was sent. For example:
DYLogger: <DYDeveloper> trackEvent called with: Push Notification Opt In and props: {
cuidType = pushID;
dyType = "message-optin-v1";
pushID = edd73de9ceb7df77b7eb4ef4d3571edfadddef5ef5e7cd1d735f36f7a6f8777f;
}
If the issue persists, contact Customer Support.
Templates
You can use any of the following templates to control the look and feel of your notifications. Upon request, a custom template can be created using JSON.
Basic Text Message
A push notification comprise of a basic text content.
Image
A rich push notification comprised of a custom image and (optionally) action buttons.
Single Product
A rich push notification comprised of a dynamically selected product and (optional) action buttons. The product selection is based on the chosen strategy and may include the product’s image and name, price and any and other property available from the product feed.
Product Slider
A rich push notification comprised of multiple products and (optional) action buttons within a carousel. The product selection is based on the chosen strategy and can include the product’s image, name, price and any other property available from the product feed.
Sample template JSON code
{
"aps": {
"alert": {
"title": "Test Title",
"subtitle": "Test sub",
"body": "Test body"
}
},
"data": {
"tracking": "${dyTracking}"
}
}
The attributes aps → body and data → tracking are mandatory. The attributes title and subtitle are optional.
Notifications triggered by events
This section describes how triggers work for push notifications following triggering events.
User identification
The user is identified by syncing Dynamic Yield ID with a unique push ID assigned by the mobile operating system. Dynamic Yield assigns a unique identifier to every app user – DYID. This ID is stored within the device’s local storage and is used to track all of the user’s app activities. To send a push notification, the push ID provided by the operating system and the DYID must first be associated. This ensures that Apple and Google servers push the right message to the right user across all known devices and apps. The association is done using a dedicated API call handled by the SDK.
Trigger
The user triggers an event within the application that makes him eligible to receive a push notification. While Dynamic Yield tracks all events triggered by the app user, certain events are defined as ‘triggers’ and can be set to activate push notification messages. For such events, relevant data is automatically stored within Dynamic Yield servers and is later accessible for the creation of the message. For example, the ‘add to cart’ is defined as a ‘trigger event’ and can be set to activate the ‘cart abandonment’ push notification. The actual items that were left in the cart (the stored data) are available to be used within the message.
Send time
The notification’s ‘send time’ is determined. Until send it remains pending. Send time can be configured by setting a delay between the triggered event and the actual push. The push notification remains pending during this period.
Cancellation conditions
Message cancellation conditions are monitored while the message is pending. A set of conditions can be defined to cancel the actual push. A purchase event, for example, will suppress the a cart abandonment notification. Note: Frequency capping conditions as well as other settings might also result in suppressing a message.
Message assembly and send
When send time arrives, the push notification is assembled with its corresponding dynamic content. Rich push notifications can include images and product metadata relevant to the specific push notification type. For example, a ‘cart abandonment’ message can include one or more products in the user’s cart; a ‘win back’ notification may include one or more recommended products personalized for the user. Send is done by Dynamic Yield firing an activation API to Apple or Google notification servers. The API call includes the recipient Push ID, the push notification message text.