Event Overview

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 well known / recommended events, 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.

  • Built in events (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

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")

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:

Last updated