OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You'll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Discussions

Outcomes

Track events and actions within your app or site resulting from push notifications from OneSignal.

NEW FEATURE!
OneSignal allows you to track various outcomes (events or actions) resulting from push notifications. This includes tracking things you care about like event counts (e.g. how many users purchased a product), sums (useful for tracking revenue and more), or unique events (counted only once).

Webinar Video

See our Head of Product, Zack Hendlin, go over how advanced analytics powered by OneSignal can help track ROI.

Watch the webinar here.

Outcome Types

Outcome
Description
Details

Notification Clicks

INCLUDED
Tracks number of clicks/opens on a push notification.

A click is generated when the user presses the notification which triggers the app and removes the notification from the device.

Clicks always measured with direct attribution.

Paid Feature
COUNT: Number of sessions that resulted from a push notification.
SUM: Cumulative session time of all sessions resulting from a push notification (in seconds).

A new session is created when a user clicks a notification resulting in the app opening.

If a notification is clicked but app is already open, then no new session is created.

Paid Feature
Any custom outcome such as purchase amount, action taken by the user, or any other outcome of interest.

Note: limit to 100 custom outcomes

This is set with code.

Direct Vs Influenced Attributions

Outcomes can be directly attributed to a notification or influenced by a notification. This depends on if a session is created by the notification click which opens the app or website from being closed.

If a user has the app or site open and clicks the notification, a session is not created and the Outcome will be influenced. Similarly, if up to 10 notifications are sent and never clicked, but the user performs the Outcome within the specified Attribution Window (default 24 hours), then up to all 10 notifications will track the outcome as influenced.

Clicks (count) will always be directly attributed to a notification and do not rely on a session.

Attribution
Description

DIRECT

The Outcome happened during a session that was created due to a clicked push.

INFLUENCED

The Outcome was registered within the Attribution Window (default 24 hours) of the push but didn’t occur during a session directly initiated from a push.

Note: Only the 10 most recently sent notifications (per device) get influenced attribution

TOTAL

The Total (Direct + Influenced)

Influenced Opens

Dashboard > Settings > Analytics

This is the Attribution Window - the amount of time influenced Outcomes can be attributed to a notification. You can set 15 minutes, 1 hour and 24 hours which is default.

If you keep the Attribution Window to the default 24 hour maximum, any Outcome Types except Clicks will show in the Outcomes table for up to 10 most recent notifications.

For example:

  • Attribution Window set to 24 hours and you send 15 notifications that day.
  • UserA does not click any notifications but opens the app.
    Then the last 10 most recent notifications will have updated Session Duration count and sum.
    If you also specified a Custom Outcome, like the user buys a product, then the last 10 notifications will also show that Custom Outcome in the Outcomes Table.

Count Vs Sum

For Session Duration and Custom Outcomes, there are two metrics available: count and sum

Metric
Description

COUNT

The frequency of the Outcome (how many times it occurred)

SUM

The sum of all Outcome values (only available for Outcomes that register values)

Outcome Values

One of Outcomes' most powerful features is the ability to store numeric values in the Sum Row with the firing of each Outcome.

For example, you may want to track how much revenue can be attributed to a push campaign. In this example, you can register a monetary value with a Custom Outcome such as a purchase. Simply pass an outcome name with the number you wish to associate it with. You can then see these data in the Message Report page for any given push notification.

// "Purchase" button pressed in the app
   ...
   OneSignal.sendOutcomeWithValue("Purchase", 18.76);
// "Purchase" button pressed in the app
   ...
   [OneSignal sendOutcomeWithValue:@"Purchase" value:18.76]

Session Duration

Sessions are created when the user opens the app or website from previously being closed.

A direct session is registered when the user opens the app or site from a push.
An influenced session is registered when the user opens the app within the Attribution Window (default 24 hours). If you send up to 10 notifications and the user visits the app or website within the Attribution Window, then all 10 notifications will have updated *influenced Session Duration count and sum.


Implementing Outcomes

Default Outcomes

Update to the latest version of the SDK. Free users automatically get clicks right out of the box. Paid plan users will get clicks and sessions.

Custom Outcomes

Add a line of code where you want an Outcome to fire (e.g. on "add to cart" button or "upgrade subscription" button).

There are three methods for custom Outcome types:

Method
Description

sendOutcome

Increases the "Count" by 1 and will be counted each time sent.

sendOutcomeWithValue

Increases the "Count" by 1 and the "Sum" by the value. Will be counted each time sent.

sendUniqueOutcome

Increases "Count" by 1 only once.

Missed Outcomes

Failures for Outcomes are cached on the device and re-attempted on the next OneSignal init.


Message Report

The Message Report contains all Outcome Statistics as well as information such as delivery numbers, click-through rate, and influenced opens.

Outcomes can be viewed as a graph...

or as a table:


Examples

E-Commerce Site

Online stores can use OneSignal push notifications to drive users back to abandoned carts, flash sales, promotions, and more. With Outcomes, store owners can now easily correlate push notifications to user actions such as an add-to-cart, purchase, or coupon redeemed. For purchases, outcomes go even further than simple counts and can track purchase amounts. This allows site owners to easily view the sum total of revenue generated from individual pushes.

OneSignal.sendOutcomeWithValue("Purchase", 18.76);
[OneSignal sendOutcomeWithValue:@"Purchase" value:18.76]

Dating app

Online dating apps may want to re-engage users by using a push to notify them of a match, a new like, or simply to get them swiping. By using Outcomes, a dating app developer can see whether a push notification led to a user event such as initiating a chat with a match or a 34-second swipe session. These data can then be used to refine notification and targeting strategies.

In the following example, we want to track whether a user started swiping dating profiles after a push. Since we wouldn't want to count every swipe as a conversion, we use sendUniqueOutcome

OneSignal.sendUniqueOutcome("Swipe");
[OneSignal sendUniqueOutcome:@"Swipe"]

FAQ

What platforms are supported?

Support is currently limited to these mobile platforms:

SDK

Web Push

COMING SOON

iOS Native

COMING SOON

Android Native

SUPPORTED

React Native

ANDROID SUPPORTED
IOS COMING SOON

Unity

ANDROID SUPPORTED
IOS COMING SOON

Cordova

ANDROID SUPPORTED
IOS COMING SOON

Xamarin

ANDROID SUPPORTED
IOS COMING SOON

Flutter

ANDROID SUPPORTED
IOS COMING SOON

Corona

NOT SUPPORTED

What happens if a device is offline?

Data for fired outcomes are queued to be sent to OneSignal once the device is online again.

How long is outcome data stored?

  • Notifications sent from the dashboard keep their Outcome data forever.
  • Notifications sent via the API have a 30-day retention of outcomes before being purged.

Are there user-level outcomes?

There is currently no support for user-level outcomes. This feature will be available in late 2019.

Can I export outcomes?

You can export a set of outcomes or all outcomes as a CSV. API access is currently unavailable.

Can I store strings as values in Custom Outcomes?

This is not supported

If a user backgrounds the app after clicking a notification and then comes back to it, firing an Outcome, is it counted direct or influenced?

As long as the user returns to the app within 30 seconds after backgrounding it, the session will still be considered the original session and will get direct attribution.

Do outcomes work with email or In-App Messages?

Currently outcomes only work with push notifications.

Outcomes


Track events and actions within your app or site resulting from push notifications from OneSignal.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.