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
  • Watching Events
  • Sending Events
  • Using Events

Was this helpful?

  1. Events

Event Overview

Last updated 9 months ago

Was this helpful?

The more Critical Moments knows about your user's behaviours, the better you can target and optimize.

Be sure to log the important events in your user's journey for improved targeting and optimization.

There are three types of events in Critical Moments:

  • Recommended events are events like "sign_up", "in_app_purchase" that many apps have in common. We maintain a list of , and suggest you log as many of these as possible (except where a concept doesn't apply to your app).

  • Custom events: you can log any event you like. Be sure to instument the important events for your app's primary use cases as these are critical for understanding your users and optimizing. For example a reminders app would probably need events like created_list, add_item, completed_item, at minimum.

  • (like app_start, action:action_name) are tracked automatically, and don't require additional integration in code.

Watching Events

It's often useful to have Critical Moments log all events during development. To log events only when debugging, add this to your AppDelegate before calling the start method of Critical Moments:

#if DEBUG
CriticalMoments.sharedInstance().setLogEvents(true)
#endif
#ifdef DEBUG
[CriticalMoments.sharedInstance setLogEvents:true];
#endif

Sending Events

You can send events from anywhere in your codebase in 1 line:

// In your imports section add: 
import CriticalMoments

// Send a recommended event
CriticalMoments.sharedInstance().sendEvent("signed_in")

// Send a custom event
CriticalMoments.sharedInstance().sendEvent("created_list")
// In your imports section add: 
@import CriticalMoments;

// Send a well known event
[CriticalMoments.sharedInstance sendEvent:@"signed_in"];

// Send a custom event
[CriticalMoments.sharedInstance sendEvent:@"created_list"];

If you already use an analytics framework like Firebase Analytics, consider making a wrapper which distributes your events to both your it and Critical Moments. This will minimize work, and ensure new events are automatically captured in both platforms.

Events are tracked in a local database, not sent to a server. They work offline, and are great for user privacy.

Using Events

Events can be used in several ways:

fire actions when an event occur

🎪
well known / recommended events
Built in events
Triggers
Conditions can query the event history database