Event and Property History
Critical Moments builds a local database of all events, and a sampling of the history of each property. This database can be queried in conditions using functions described below. This unlocks powerful use cases combining the user's current state, with their usage and device history.
Privacy Built In
This database is local to the user's device, not server based. All queries and evaluation happen locally on the user's device.
Event History
Every event is stored in the event history database, and can be queried with the following functions:
Example
Presenting an important call to action like "rate us" or "subscribe" has the best chance of success after the user gets value from the app, but you typically want to wait until they have completed the action a few times before asking. Here's an example for a reminders app, which asks them to rate, but only after marking a task as complete a few times, and waiting 60 days between asks:
eventCount('completed_task') > 4 && (latestEventTime('asked_to_subscribe') == nil || latestEventTime('asked_to_subscribe') < now() - duration('60d'))
Property History
You can access property history via the propertyEver function in conditions.
Example
Checking if the user isn't on low_power_mode can improve the chance a call to action like "rate us" or "subscribe" succeed. However some users leave it on permanently and you don't want to ignore them forever. Your conditional check can be improved by ensuring they have had it off at some time in the past:
(!device_low_power_mode && propertyEver('device_low_power_mode', false))
Sampling Rate
Properties are sampled at different times:
Custom properties are sampled when set
Most properties are sampled on app startup
Some properties that are power or time intensive are only sampled when accessed.
See here for how each propety is sampled, and take into account the sampling style when using this function.
Last updated