Respectlytics Respect lytics
Menu
Flutter Paywall conversion Privacy-first

How to track paywall conversion in Flutter without personal data

Paywall conversion is the single highest-stakes event in most subscription apps — and the one most likely to leak personal data into your analytics pipeline. Respectlytics helps developers avoid collecting personal data in the first place: in Flutter, you emit a single named event when a purchase succeeds, with **no price, no product ID, no user identifier**. The session ID rotates every two hours, so a purchase becomes "a purchase happened in this session" — sufficient for funnel analysis, insufficient for cross-app re-targeting. Below: a complete Flutter integration, the privacy gotchas specific to your platform, and how the resulting Respectlytics events compare to Firebase Analytics or Mixpanel.

The tracking call is one line. Place it where your purchase observer sees a successful transaction — the same callback you'd already use to grant entitlement to the user. Avoid the temptation to pass price, currency, product SKU, or user ID; Respectlytics's API rejects extra fields with a 400 Bad Request, so this fails fast in development if a teammate adds a field by reflex.

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:respectlytics_flutter/respectlytics_flutter.dart';
import 'package:in_app_purchase/in_app_purchase.dart';

void listenForPurchases() {
  InAppPurchase.instance.purchaseStream.listen((purchases) {
    for (final purchase in purchases) {
      if (purchase.status == PurchaseStatus.purchased ||
          purchase.status == PurchaseStatus.restored) {
        // No metadata. Session-scoped, RAM-only.
        Respectlytics.track('paywall_purchase');
        InAppPurchase.instance.completePurchase(purchase);
      }
    }
  });
}

Call `listenForPurchases` once at app startup, after Respectlytics is configured. Cancel the subscription appropriately on app shutdown if you have one.

Privacy & implementation notes

Most analytics SDKs default to tying purchase events to a persistent `user_id` or device-level identifier. Respectlytics's `session_id` rotates every two hours, so a paywall purchase becomes "a purchase happened in this session" — sufficient for funnel analysis, insufficient for resale or cross-app re-targeting. This is the data-minimization trade-off in one line.

The natural aggregation bucket is **(country, platform, day)**. "78% of paywall views convert in DE on iOS today" is a useful comparison even without per-user identity. Most paywall A/B-test decisions are made on differences this granular — going down to per-user is operationally expensive and rarely changes the conclusion.

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

What gets sent on a paywall purchase Firebase Analytics (default) Mixpanel (default) Respectlytics
IDFA / AAID Yes (with user consent) Optional Never
Persistent user ID app_instance_id distinct_id Never
Purchase amount / currency Recommended Recommended Rejected by API
Product / SKU identifier Recommended Recommended Rejected by API
Transaction ID Recommended Recommended Rejected by API
IP address stored Yes Yes (90-day default) Used transiently for country, then discarded
What you can compute Per-user LTV, cohort revenue Per-user LTV, cohort revenue Session-grouped funnel, country-level conversion rate

Frequently asked questions

How do we attribute revenue without a user ID?

You don't, at the user level. You attribute by **session, country, and day**. For most product decisions — "is the new paywall design converting more sessions in DE on iOS?" — that's enough. If you need per-user LTV for investor reporting, that lives in your billing system (Stripe, RevenueCat, App Store Connect) — not in your product analytics.

Can we still A/B-test paywall variants?

Yes. Emit different `event_name` values for each variant — e.g. `paywall_purchase_a`, `paywall_purchase_b`. Aggregation buckets them automatically. No randomized user assignment is stored — variant assignment lives in the client until the event fires.

What about refunds and chargebacks?

Out of scope for product analytics. Your billing system already has authoritative refund data, with the user IDs and amounts you legitimately need to act on. Mixing those into your conversion funnel produces double-counted noise — keep them separate.

Will the App Store reject my app for not collecting purchase metadata?

No. Apple's review guidelines do not require you to collect product or price metadata. Your `Receipt` and `transactionIdentifier` already exist on-device and on Apple's servers — duplicating them into your analytics pipeline is a choice, not a requirement.

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.