Skip to main content
For API usage, see the Clix SDK GitHub repositories for each platform:

When to Track Events

1

Identify the user action

Decide which user interaction or system event to track—for example, button taps, feature milestones, or funnel checkpoints.
2

Attach meaningful properties

Attach key-value properties that provide relevant details about the event (e.g., plan type, screen name, experiment variant).

Example Usage

Clix.trackEvent(
  "signup_completed",
  properties: [
    "method": "email",
    "discount_applied": true,
    "trial_days": 14,
    "completed_at": Date()
  ]
)

Property Types and Formatting

properties accepts a key/value map. The SDK normalizes values before sending them:
  • Booleans, numbers, and strings map directly to JSON primitives.
  • Date-like values are serialized to ISO 8601 strings (2024-05-16T09:30:00Z).
  • Unsupported objects default to a string representation. Prefer serializable primitives to keep reporting clean.

Error Handling

Event tracking calls can throw errors. Always handle errors for robust apps:
do {
  try await Clix.trackEvent(
    "signup_completed",
    properties: [
      "method": "email",
      "discount_applied": true,
      "trial_days": 14,
      "completed_at": Date()
    ]
  )
} catch {
  print("Failed to track event: \(error)")
}