Learn how to track user actions and revenue from push notifications and in-app messages using OneSignal Custom Outcomes. Customize attribution and measure engagement with flexible outcome types across platforms.
OneSignal Custom Outcomes allow you to track meaningful user actions resulting from push notifications and in-app messages. These actions—such as purchases, signups, or app events—can be tracked with count, sum, and unique metrics, giving you insight into the impact of your messaging campaigns.
You can trigger an Outcome by adding a line of code when a user completes a specific action (e.g., taps “Add to Cart” or “Upgrade”).
Outcome Type | Mobile SDK Method | Web SDK Method | Description |
---|---|---|---|
Standard Count | addOutcome | sendOutcome | Increases the count by 1 every time it’s called. No value tracking. |
Value (Sum) | addOutcomeWithValue | sendOutcome | Increases count by 1 and sum by the specified numeric value. Useful for revenue tracking. |
Unique Count | addUniqueOutcome | sendUniqueOutcome | Increases count by 1, only once per attribution window. Best for binary user actions like “Started Swipe Session” or “Tapped CTA”. |
Outcomes support two key metrics:
Metric | Description |
---|---|
Count | Number of times the outcome event was triggered |
Sum | Total of all numeric values sent with the outcome (if applicable) |
Outcomes with values always round to the nearest whole number.
Example: To track revenue from a purchase:
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.
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
This “Swipe” outcome will only be attributed once to the push that triggered it. Examples:
Within the Notification Opened/Clicked listener methods of our SDK, you can setup Outcomes to increment how many devices clicked a push by their set language. This will require some native code to detect the language of the device, but you can then pass that language into the Outcome like so:
Within the Notification Opened/Clicked listener methods of our SDK, you can setup Outcomes to increment which platform’s specifically were clicked. This is generic for iOS and Android as you can set OneSignal.addOutcome("iOS")
or OneSignal.addOutcome("Android")
in your mobile app’s click handler, but if you want to track web push platforms as well, you can use this for example:
Disable specific Outcomes from being tracked in the dashboard Settings > Push & In-App > Outcomes Tracking.
From here, you can click the Stop Tracking button to select an outcome to stop tracking in the dashboard. Once you have stopped tracking outcomes, you will see them listed here and can start tracking them again by clicking the Start Tracking link.
Currently custom outcomes be added to actions on Push and In-App Messages only.
Outcomes sent through In-App messages will show as “Unattributed” and will set a tag on the device in format: outcome name : true
.
You can export a set of outcomes or all outcomes as a CSV. We also provide API access to outcomes for an individual notification or for all the notifications.
This is not supported.
Data for fired outcomes are queued to be sent to OneSignal once the device is online again.
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.
If you change the attribution window from 24 hours to 1 hour for example, then the 1 hour window will take affect on a per-device basis once each device opens the app from a brand new session. This new session is created after 30 seconds of being outside the app.
Outcomes for web requires the use of service workers to track outcome events. Since Safari does not implement Service Workers in the same way as Chromium based browsers, it will not track outcomes as Direct or Influenced, but will be tracked as Unattributed.
OneSignal only counts a session after the user has left the app for over 30 seconds. If you close the app or website and return to it within 30 seconds, it will not be a new session.
For instance, Apple’s analytics tracks the session as the number of times the app has been used for at least two seconds. If the app is in the background and is later used again, that counts as another session.
Learn how to track user actions and revenue from push notifications and in-app messages using OneSignal Custom Outcomes. Customize attribution and measure engagement with flexible outcome types across platforms.
OneSignal Custom Outcomes allow you to track meaningful user actions resulting from push notifications and in-app messages. These actions—such as purchases, signups, or app events—can be tracked with count, sum, and unique metrics, giving you insight into the impact of your messaging campaigns.
You can trigger an Outcome by adding a line of code when a user completes a specific action (e.g., taps “Add to Cart” or “Upgrade”).
Outcome Type | Mobile SDK Method | Web SDK Method | Description |
---|---|---|---|
Standard Count | addOutcome | sendOutcome | Increases the count by 1 every time it’s called. No value tracking. |
Value (Sum) | addOutcomeWithValue | sendOutcome | Increases count by 1 and sum by the specified numeric value. Useful for revenue tracking. |
Unique Count | addUniqueOutcome | sendUniqueOutcome | Increases count by 1, only once per attribution window. Best for binary user actions like “Started Swipe Session” or “Tapped CTA”. |
Outcomes support two key metrics:
Metric | Description |
---|---|
Count | Number of times the outcome event was triggered |
Sum | Total of all numeric values sent with the outcome (if applicable) |
Outcomes with values always round to the nearest whole number.
Example: To track revenue from a purchase:
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.
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
This “Swipe” outcome will only be attributed once to the push that triggered it. Examples:
Within the Notification Opened/Clicked listener methods of our SDK, you can setup Outcomes to increment how many devices clicked a push by their set language. This will require some native code to detect the language of the device, but you can then pass that language into the Outcome like so:
Within the Notification Opened/Clicked listener methods of our SDK, you can setup Outcomes to increment which platform’s specifically were clicked. This is generic for iOS and Android as you can set OneSignal.addOutcome("iOS")
or OneSignal.addOutcome("Android")
in your mobile app’s click handler, but if you want to track web push platforms as well, you can use this for example:
Disable specific Outcomes from being tracked in the dashboard Settings > Push & In-App > Outcomes Tracking.
From here, you can click the Stop Tracking button to select an outcome to stop tracking in the dashboard. Once you have stopped tracking outcomes, you will see them listed here and can start tracking them again by clicking the Start Tracking link.
Currently custom outcomes be added to actions on Push and In-App Messages only.
Outcomes sent through In-App messages will show as “Unattributed” and will set a tag on the device in format: outcome name : true
.
You can export a set of outcomes or all outcomes as a CSV. We also provide API access to outcomes for an individual notification or for all the notifications.
This is not supported.
Data for fired outcomes are queued to be sent to OneSignal once the device is online again.
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.
If you change the attribution window from 24 hours to 1 hour for example, then the 1 hour window will take affect on a per-device basis once each device opens the app from a brand new session. This new session is created after 30 seconds of being outside the app.
Outcomes for web requires the use of service workers to track outcome events. Since Safari does not implement Service Workers in the same way as Chromium based browsers, it will not track outcomes as Direct or Influenced, but will be tracked as Unattributed.
OneSignal only counts a session after the user has left the app for over 30 seconds. If you close the app or website and return to it within 30 seconds, it will not be a new session.
For instance, Apple’s analytics tracks the session as the number of times the app has been used for at least two seconds. If the app is in the background and is later used again, that counts as another session.