Skip to main content
This page is part of Example app: a full OneSignal integration, which follows one real app from end to end. The app is Clean Beans, a cleaning rota for shared homes, built with Expo (React Native) and a Supabase backend. Identity tells OneSignal who someone is. Tags and events tell it what they are like and what they do. Clean Beans uses three kinds of data, each for a different job.

Tags: the user’s current state

After sign-in, after each cleaning session, and after a profile edit, the app gathers a few facts from Supabase and writes them as tags.
src/lib/onesignalSync.ts
Tag values are strings. Store timestamps as Unix seconds so that OneSignal’s time operators can compare them.

Custom events: what just happened

The app records an event when a cleaning session starts and another when it finishes.
src/lib/onesignalSync.ts
src/lib/onesignalSync.ts
The completed event carries two numbers, tasks_completed and minutes_cleaned. They are sent as numbers, not strings, because Conversion Metrics can only total a property that OneSignal has seen as a number. The session screen fires the event and refreshes the tags at the moment the user confirms what they cleaned.
app/clean-session.tsx

Conversion Metrics: what your messages achieved

A Conversion Metric counts a custom event and credits it to the messages that came before it. With the event above, Clean Beans can see how many cleaning sessions each reminder led to, and how many minutes of cleaning that added up to.
A OneSignal message report showing conversion metrics for cleaning sessions

A push message report showing the cleaning sessions and minutes attributed to it.

Dashboard setup. Go to Settings > Analytics > Conversion Metrics and create one metric per row.
The “Track a value for each event” option only appears once the event has arrived with a number-typed property, and it can only be turned on when the metric is created. Send the event from a real session first, check that it has arrived in Data > Events & Conversions, and then create the two value metrics.
Conversion Metrics replace Custom Outcomes (OneSignal.Session.addOutcome()), which are being deprecated. Clean Beans originally planned to use Outcomes and switched before building. Custom metrics require a paid plan. Clicks and app sessions are tracked on every plan.

Tags

Add, remove, and use tags.

Custom events

Send events from the SDK or your backend.

Conversion metrics

Attribution windows and reporting.