Treat each onboarding step as its own event name (`onboarding_step_1_complete`, `onboarding_step_2_complete`, …, `onboarding_complete`). Funnel rates are then session-grouped event-name counts — no per-user attribution required. The pattern below is what we recommend for most Flutter apps.
▸ Install the Flutter SDK
# pubspec.yaml
dependencies:
flutter:
sdk: flutter
respectlytics_flutter: ^3.0.0
Pure Dart — no platform channels for analytics. Same code on every platform Flutter compiles to (iOS, Android, web, macOS, Windows, Linux). On web, events are sent via the REST API; mobile platforms use the same path.
▸ Initialize Respectlytics in Flutter
import 'package:flutter/material.dart';
import 'package:respectlytics_flutter/respectlytics_flutter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Respectlytics.configure(appKey: '<YOUR_APP_KEY>');
runApp(const MyApp());
}
Initialize in `main()` after `WidgetsFlutterBinding.ensureInitialized()` and before `runApp()`. The future completes immediately on configuration; events queued before completion are flushed once the network is available.
▸ Track the event in Flutter
import 'package:respectlytics_flutter/respectlytics_flutter.dart';
import 'package:flutter/material.dart';
class OnboardingFinalStep extends StatelessWidget {
final VoidCallback onFinish;
const OnboardingFinalStep({super.key, required this.onFinish});
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: () {
Respectlytics.track('onboarding_complete');
onFinish();
},
child: const Text('Get started'),
);
}
}
Each step is its own track call with its own `event_name`. Funnel computation happens server-side from the per-event-name session counts.
✦ Privacy & implementation notes
Common mistake: emitting one `onboarding_step_completed` event with `{step: 1}` as a parameter. Respectlytics's API rejects that with a 400. Instead, emit `onboarding_step_1_complete`, `onboarding_step_2_complete`, etc. as distinct event names — Respectlytics's funnel auto-discovery picks them up without any manual configuration.
The most frequent unintentional PII leak is sending the user's email or phone number as event metadata ("so we can re-engage them later"). The API returns a 400 with the offending field name — so this fails on the first integration test, not after months of unnoticed silent collection.
The Flutter SDK is pure Dart. No `MethodChannel`, no platform-specific iOS or Android plugin code. The same code runs on every platform Flutter supports — including web and desktop targets. This eliminates one common audit surface ("what's the Android implementation doing?").
Always initialize after `WidgetsFlutterBinding.ensureInitialized()` and before `runApp()`. If you skip the binding step, the configure call will throw on platforms that need a binding for asynchronous I/O. The SDK documentation example uses this pattern by default.
⇋ How this compares to other analytics SDKs
| Onboarding completion event | Firebase Analytics | Mixpanel | Respectlytics |
|---|---|---|---|
| Per-user identity | app_instance_id | distinct_id (if signed in) | Never |
| Step metadata as parameters | Up to 25 params per event | Up to 250 properties | Use distinct event_name per step |
| Email / signup_method as event property | Recommended | Recommended | Rejected by API |
| Session-level funnel computation | Yes (session-scoped tables) | Yes (insights builder) | Yes (default) |
| What you store about who finished | a lot | a lot | event_name + session_id (rotated) + timestamp + platform + country |
❓ Frequently asked questions
Why use distinct event_names per step instead of one event with a step parameter?
Two reasons. First, Respectlytics's API rejects custom parameters — you have five fields, period. Second, distinct event names compose better with the automatic funnel-discovery feature: any monotonic sequence of event names in a session is a candidate funnel, no manual configuration required.
How do we segment onboarding completion by acquisition source?
If your acquisition source is one of N values (organic, paid_search, referral, …), emit it as part of the event name: `onboarding_complete_organic`, `onboarding_complete_paid_search`, etc. The aggregation engine groups them. Avoid composing freeform combinations — keep your taxonomy short.
What about completion time / duration?
Two timestamped events in the same session implicitly carry duration — compute it server-side in your dashboard, not as an event property. The raw timestamps stay on Respectlytics; the duration metric is your derivation.
Should we track each step view or just step completions?
Just completions, in nearly every case. "Saw step 3" with no completion is rarely actionable — a session that has `onboarding_step_2_complete` but no `onboarding_step_3_complete` already tells you they got stuck.