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
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 push message report showing the cleaning sessions and minutes attributed to it.
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.