Critical Moments Docs
Quick StartHomepageAccount
  • Documentation Home
  • What is Critical Moments?
  • Quick Start
  • Concepts Overview
  • Remote Control / Service
    • Host Config on Github Pages
  • Config File Structure
  • Demo App
  • Homepage & Account
  • 📚Guides
    • Mobile App Toolbox: 13 Features Most Apps Need
    • Reduce App Churn with Notifications
    • Improve your App Store Rating
    • Feature Flags Guide
  • ⏰Notifications
    • Intro to Notifications
    • Notifications Spec
    • Smart Delivery
    • Badges
  • 🎯Conditional Targeting
    • Intro to Conditions
    • Built-in Properties
    • Custom Properties
    • Syntax and Operators
    • Conditional Guides
      • Working with Dates
      • Locations and Weather
      • Event and Property History
  • 🎪Events
    • Event Overview
    • Recommended Events
    • Built-In Events
  • 💬Actions / In App Messaging
    • Actions Overview
    • Modals
      • Modal Content Sections
      • Modal Buttons
      • Modal Images
    • Banners
    • Alerts
    • App Reviews
    • Open Link
    • Custom Actions
    • Conditional Actions
    • Triggers
  • 🎨Themes
    • Theme Overview
    • Built In Themes
  • ⛳Feature Flags
    • Feature Flag Guide
    • Conditional Feature Flags
    • Named Conditions Config
  • 🔑Trustless SaaS
  • 👋Support
  • 👩‍💻SDK API Reference
Powered by GitBook
On this page
  • Event History
  • Property History

Was this helpful?

  1. Conditional Targeting
  2. Conditional Guides

Event and Property History

Last updated 1 year ago

Was this helpful?

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 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 for how each propety is sampled, and take into account the sampling style when using this function.

🎯
here
eventCount
eventCountWithLimit
latestEventTime
propertyEver