Respectlytics Respect lytics
Menu
Flutter Subscription cancellation Privacy-first

How to track subscription cancellations in Flutter without personal data

Subscription cancel is the cleanest churn event you can collect — and the most tempting place to attach "reason for cancelling" survey responses, which always balloon into free-text PII. Respectlytics helps developers avoid collecting personal data in the first place: in Flutter, cancel is one named event. Cancellation reason belongs in your customer-support tooling, not your analytics pipeline. Below: where to fire, how to compute churn rate, and the survey trap.

Like renewals, cancellation events ideally come from your billing system's webhooks. Cancellation initiated in your app (a settings-screen "cancel subscription" CTA) is also fair game for a client-side fire, but use the same event_name so the two paths aggregate together.

Install the Flutter SDK

yaml Respectlytics
# 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

dart Respectlytics
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

dart Respectlytics
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:respectlytics_flutter/respectlytics_flutter.dart';

Future<void> openCancelSubscription() async {
  Respectlytics.track('subscription_cancel_initiated');
  final url = Platform.isIOS
    ? 'https://apps.apple.com/account/subscriptions'
    : 'https://play.google.com/store/account/subscriptions';
  await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
}

Effective cancellation fires server-side from your billing webhook handler — use event_name: "subscription_cancelled" to distinguish from initiation.

Privacy & implementation notes

Free-text cancellation surveys produce two outputs: useful product insight, and PII soup ("my name is X and I'm leaving because…"). Respectlytics's API rejects free-text fields outright — survey responses belong in a customer-support tool with proper retention controls and access policies, not in analytics.

Cancel-initiated and cancel-effective are different events with different product implications. Conflating them under one subscription_cancelled event loses the save-rate signal between them — typically the most actionable churn metric a subscription product has.

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

Subscription cancel eventFirebase AnalyticsMixpanelRespectlytics
Cancellation reason as parameterRecommendedRecommendedUse distinct event_name
Free-text reason / feedback surveyCommonCommonForbidden (PII)
Per-user identityYesYesNever
Cancel-then-resubscribe linkagePer-userPer-user (Identity Merging)Out of scope
Churn *rate* by country / platformYesYesYes (default aggregation)

Frequently asked questions

How do we know *why* users cancel without storing reasons?

Two layers. For quantitative reasons (tier, payment-method failure, platform), use distinct event names: subscription_cancelled_voluntary, subscription_cancelled_payment_failed. For qualitative reasons ("feature X was missing"), run a customer-support intake — that's not analytics' job.

Should we fire when the user *initiates* cancel, or when it actually takes effect?

Both, with distinct event names: subscription_cancel_initiated (immediate intent signal) and subscription_cancelled (effective at billing-period end). Some teams convince ~10% of initiated-cancels to stay; the funnel between the two events is your save rate.

What about involuntary cancels (failed payment, account closed)?

Distinct event name: subscription_cancelled_involuntary. The reasons differ fundamentally from voluntary cancels, and so do the product responses (you might dunning-retry payment-failed, but not voluntary).

Do we still need this in Respectlytics if our billing system has cancellation data?

Yes — for in-app correlations. "What feature did users last touch before initiating cancel?" needs both the cancellation event and other in-app events in the same analytics pipeline. Your billing system can't answer that.

Related guides

Track what matters. Collect nothing you don't.

Five-field event schema, RAM-only event queue, no IDFA, no AAID, no persistent user IDs. Helps developers avoid collecting personal data in the first place.