Analytics: events, analyses and funnels

What your users do inside your app, measured by the SDK and read in the studio: sessions, screens, product events, analyses, funnels, feature flags and A/B tests.

The SDK first, the dashboard after.


What you need

PlatformPackageSymbol
iOS 16SPM product AppwinAnalyticsAppwinAnalytics
Android 7.0 (API 24)io.appwin:appwin-analyticsio.appwin.analytics.AppwinAnalytics

Native only. Neither the Flutter plugin nor the React Native bridge exposes Analytics today - Community, Support and Notifications do. On those two platforms the product is still to be wired.

Two conditions before an event leaves:

  1. AppwinCore.configure called at launch - see Install the SDK.
  2. initialize() answering ready. It is what starts the capture: sessions and installs are only recorded from that point on.

The heavy lifting - persisted queue, batching, offline buffering, session tracking, consent - lives in AppwinCore. The Analytics module is the product's public surface, the way AppwinSupport is of its own.


Capturing

swift
import AppwinAnalytics

AppwinCore.configure(projectAppId: "your-app-id")

if await AppwinAnalytics.initialize().isReady {
  AppwinAnalytics.screen("home")

  AppwinAnalytics.track("purchase", props: [
    "plan": "pro",
    "seats": 3,
  ])
}

track never blocks and never throws: the event is written to disk and uploaded in batches, offline included.

What the SDK captures without you: session_start, session_end (with its duration), app_install, app_update. screen_view comes from your call to screen.

The naming rules

RuleDetail
Event name^[a-z][a-z0-9_]{0,63}$ - lowercase, digits, underscores
Reserved namessession_start, session_end, screen_view, app_install, app_update: the SDK emits them, you do not shadow them
Properties20 keys at most; values as string, boolean or number
LengthsString values truncated to 256 characters, screen names to 128

An invalid event is dropped, with a debug log. No exception: a measurement must not bring down the app it measures.


The default is granted - an opt-out. Most studios fall under the first-party audience-measurement exemption and have no consent screen to show.

If yours has one, set unknown at launch: events are captured and persisted, but nothing is uploaded. Then relay the user's answer.

swift
// At launch, before configure if you like.
AppwinAnalytics.setConsent(.unknown)

// Then, once the user has answered:
AppwinAnalytics.setConsent(.granted)   // uploads the backlog
AppwinAnalytics.setConsent(.denied)    // purges it and mutes capture
ValueCaptureUpload
grantedYesYes, the backlog goes with it
unknownYes, to diskNo
deniedNoNo, and the queue is purged

The public surface

FunctionWhat it does
initialize()Asks the server for its verdict and starts the capture. Before anything else.
track(name, props)Queues a custom event. Does not block, does not throw.
screen(name)Emits the reserved screen_view. Screen names feed funnel steps and breakdowns.
flush()Forces an immediate upload of the queue. Rarely needed: it already flushes on volume, on a timer, and when the app goes to the background.
setConsent(consent)Sets the GDPR consent: granted, unknown or denied.
isReadyThe last verdict from initialize(), without another call.

Reading the data

Analytics in the sidebar, five entries:

EntryWhat you do there
HomeThe health of the stream (last event received), pinned dashboards and recently viewed ones
AnalysesAn analysis is a saved query: a chart over time, a funnel or a retention grid
DashboardsAnalyses laid out as tiles on a shared board, with its own period filters
Feature flagsOne switch per key, with a rollout percentage and variants
A/B testsA multivariate flag plus one metric, and the results per variant

An analysis is created from New analysis, never in SQL. Filters set at dashboard level are merged onto each of its tiles: the period replaces the analysis's own, nothing is duplicated.

The month's event counter is shown on the page. Past your plan's quota, new events are dropped - no silent billing, but no catching up either.


Next