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
  • Trigger Config
  • Example Config

Was this helpful?

  1. Actions / In App Messaging

Triggers

Connect events to actions

Last updated 1 year ago

Was this helpful?

Simply defining a action in your config won't actually do anything. You need to trigger it somehow. The most common way is using a trigger, which connects events to actions.

Trigger Config

Triggers are defined in your . A top level triggers object contains an namedTriggers map/object, with subitems for each trigger.

Each trigger object contains:

  • eventName [string, required]: the event name which triggers this trigger

  • actionName [string, required]: the name of the action to perform when that event occurs

  • condition [string, optional]: a to evaluate when the event occurs. The action will only be fired if it evaluates to true.

Example Config

"triggers": {
    "namedTriggers": {
        "suggestWatchAppTrigger": {
            "eventName": "app_start",
            "actionName": "showSuggestWatchAppDialog",
            "condition": "hasWatch && eventCount('shown_suggest_watch_dialog') == 0"
        },
        "congratsMessageTrigger": {
            "eventName": "completed_list_item",
            "actionName": "showCongratsModal"
        }
    }
}

💬
config file
condition string