Analytics

The Appwin Analytics home page, with creation shortcuts, pinned dashboards, and recently viewed dashboards.

Analytics records the screens people view and the important actions they take in your app. You then use those events in the dashboard: trends, funnels, dashboards.

The SDK tracks installs, updates, and sessions on its own; you declare the screens and business events. No external account: once the SDK is initialized, events appear directly in your Appwin project.

Installation

  1. 1

    Install Appwin Core and Analytics

    Analytics relies on Appwin Core. Not installed yet? Start with the Quickstart, which installs Core and your modules for every platform.

    Compatibility and packages per platform
    PlatformAppwin CoreAnalytics module
    iOS 16+AppwinCore SPM productAppwinAnalytics SPM product
    Android 7.0+ (API 24)io.appwin:appwin-coreio.appwin:appwin-analytics
    Flutter 3.3+appwin_coreappwin_analytics
    React Native 0.73+@appwin/react-nativeincluded in the same package
  2. 2

    Initialize Analytics

    Call initialize() at startup, after Appwin Core. The result tells you whether Analytics is active on your plan; collection starts on the ready verdict.

    swift
    import AppwinAnalytics
    
    let result = await AppwinAnalytics.initialize()
    guard result.isReady else { return }
    

    Repeated calls are safe: the SDK keeps the last verdict so it can start offline.

Available methods

Check the module state

On iOS and Android, isReady reads the latest verdict without calling initialize() again. React Native exposes the asynchronous isReady() method. Flutter has no separate accessor: keep the value returned by initialize().

Decide which events to track

An event should describe something useful for analysis, not the shape of the interface: onboarding_completed survives a change of button or step count.

Three rules keep a tracking plan useful:

  1. a stable snake_case name that reads as a completed action;
  2. variable values in properties, not in the name;
  3. one emission, when the action is confirmed.
AvoidPreferWhy
click_finish_buttononboarding_completedDescribes the result, not the control.
plan_selected_proplan_selected with plan: "pro"Every plan stays comparable.
home_enhomeThe screen name does not follow the language.

Events recorded automatically

EventWhen it is created
app_installThe first time Analytics starts for this installation.
app_updateThe first session after the app version changes.
session_startWhen a new session begins.
session_endWhen the previous session ends after inactivity.

Do not send these yourself. screen_view and install_referrer are also reserved: the first comes from screen(), the second is handled automatically.

Send an event

track() takes an event name and, when needed, a few properties to filter or compare later.

swift
AppwinAnalytics.track("onboarding_completed", props: [
  "steps_count": 4,
  "notifications_enabled": true,
])

The event goes into a persistent on-device queue without waiting for the network: offline, the SDK uploads it later.

Properties accept only strings, numbers, and booleans. No nested objects, arrays, or personal data you do not need for analysis.

Record screen views

Call screen() when the user actually reaches a screen. Use a stable name that describes its purpose, even if its title changes.

swift
AppwinAnalytics.screen("home")

Each call produces a screen_view event, then available in filters and funnel steps.

Associate events with a user

Events use the device and session managed by Appwin Core: no need to add a user identifier to every event.

When your app knows who is signed in, associate the session with that account using Identity. Their events are then recognized across devices.

The SDK defaults to granted. This technical default is not legal guidance: the initial state depends on your purposes, your configuration, and the rules that apply to your app.

To wait for a decision, call setConsent(unknown) before configure: the SDK keeps the first events on the device without sending them, until the state changes to granted.

swift
AppwinAnalytics.setConsent(.unknown)

AppwinAnalytics.setConsent(.granted) // uploads pending events
AppwinAnalytics.setConsent(.denied)  // purges the queue and stops collection
StateLocal collectionUpload
grantedYesYes, including events that were waiting.
unknownYesNo.
deniedNoNo, and the existing queue is deleted.

Verify that data is arriving

Start the app, open a screen, trigger a test business event. In the dashboard, open Analytics → All charts: received names appear when you create a chart or funnel.

Uploads happen automatically: every 30 seconds, after 20 events, when the app enters the background, or when the network returns.

Force an upload during a test

flush() uploads pending events immediately. Use it to verify an integration, not after every event.

If an event does not appear, check in order:

  1. initialize() returned ready;
  2. consent is neither denied nor unknown;
  3. the name follows the rules below;
  4. the network is back.

Rules and limits

ItemRule enforced by the SDK
Event name1 to 64 characters matching ^[a-z][a-z0-9_]{0,63}$.
Reserved namessession_start, session_end, screen_view, app_install, app_update, install_referrer.
PropertiesUp to 20 keys; each key is at most 64 characters.
ValuesString, number, or boolean; strings are truncated to 256 characters.
Screen nameTruncated to 128 characters.
Local queueUp to 10,000 events; the oldest are dropped if the limit is exceeded.

An event with an invalid or reserved name is dropped and produces a development log. The SDK does not throw, so a measurement problem cannot interrupt the app.

Next