Habit Analytics
  • What is the Habit Analytics Platform?
  • How to integrate devices with Habit Analytics
  • How to integrate an application with Habit Analytics
  • How to create a custom mobile app with Habit Analytics
  • Selfcare
    • What is Selfcare?
    • Projects
    • Integrations
  • SDK
    • Getting Started
    • iOS Quick Start
      • Installation
      • Xcode Project Configuration
      • Usage
        • SDK Initialization
        • Configuration
        • Tracking UX Events
        • Status Codes
Powered by GitBook
On this page

Was this helpful?

  1. SDK
  2. iOS Quick Start
  3. Usage

Tracking UX Events

Tracking events

Using Habit Analytics SDK you can track UX events in your app. They can be used to gather information on UX experience, application flow or any other scenario you desire. To track an event all you need to do is call the track method like this:

HabitAnalytics.shared.track(eventName: String, properties: [String: SupportedType]?);

Event properties can be used to complement the event with additional details. They are optional and the currently supported types can be seen in the following examples:

  • No properties

HabitAnalytics.shared.track(eventName: 'ButtonX tapped');
HabitAnalytics.shared.track(eventName: 'NavigatedTo PageY');
  • String

HabitAnalytics.shared.track(eventName: 'User sign in', properties: {'type':'email'});
  • Numeric

HabitAnalytics.shared.track(eventName: 'Application started', properties: {'Loading Time':0.9 });
  • Boolean

HabitAnalytics.shared.track(eventName: 'User sign in', properties: {'First time': true });
  • Date

HabitAnalytics.shared.track(eventName: 'User sign in', properties: {'Date': Date() });
  • URL

HabitAnalytics.shared.track(eventName: 'Clicked URL', properties: {'url': URL });
  • List

HabitAnalytics.shared.track(eventName: 'Favorite Cities', properties: {'Places selected': ["Lisbon", "New York", "London"] });
PreviousConfigurationNextStatus Codes

Last updated 4 years ago

Was this helpful?