Skip to main content

Getting Started

Drop in an SDK, track events, and see funnels and retention without extra setup.

Quick Start

1. Get Your API Key

Sign up at app.mostlygoodmetrics.com and create a project. Your API key will look like mgm_proj_xxxx.

2. Install an SDK

// Package.swift
.package(url: "https://github.com/Mostly-Good-Metrics/mostly-good-metrics-swift-sdk", from: "1.0.0")

3. Initialize and Track

import MostlyGoodMetrics

// Initialize once at app launch
MostlyGoodMetrics.configure(apiKey: "mgm_proj_your_api_key")

// Track events
MostlyGoodMetrics.track("button_clicked")
MostlyGoodMetrics.track("purchase_completed", properties: [
"product_id": "SKU123",
"price": 29.99
])

// Identify users
MostlyGoodMetrics.identify(userId: "user_123")

That's it! Events are automatically batched and sent. View them in your dashboard.

What Happens Automatically

All SDKs automatically:

  • Persist events locally, surviving app restarts
  • Batch events for efficient network usage
  • Flush on interval (default: every 30 seconds)
  • Flush on background when the app goes to background
  • Retry on failure for network errors
  • Track lifecycle events like app open, install, and update

Next Steps