devfeedbackhub_analytics 2.0.0 copy "devfeedbackhub_analytics: ^2.0.0" to clipboard
devfeedbackhub_analytics: ^2.0.0 copied to clipboard

Lightweight analytics SDK for DevFeedbackHub - track tester behavior and goal completion in your app.

DevFeedbackHub Analytics SDK for Flutter/Dart #

Lightweight analytics SDK for DevFeedbackHub - track tester behavior and goal completion in your app.

Features #

  • Track custom events from testers during beta testing
  • One-time goal completion with credit rewards
  • Recurring daily goal tracking (e.g., "7 consecutive days of usage")
  • Automatic event batching and retry
  • Zero Flutter dependency (pure Dart - works in any Dart project)

Getting Started #

1. Install #

dependencies:
  devfeedbackhub_analytics: ^1.0.0

2. Initialize #

import 'package:devfeedbackhub_analytics/devfeedbackhub_analytics.dart';

void main() async {
  await DFHAnalytics.init(
    'YOUR_REQUEST_ID',  // From DevFeedbackHub dashboard
    onGoalCompleted: (goalName, credits) {
      print('$goalName completed! +$credits credits');
    },
    onRecurringProgress: (goalName, completed, target) {
      print('$goalName: $completed/$target days');
    },
  );

  runApp(MyApp());
}

3. Track Events #

// Track any event
DFHAnalytics.track('app_open');
DFHAnalytics.track('login');
DFHAnalytics.track('purchase', data: {'item': 'premium'});
DFHAnalytics.track('level_complete', screenName: 'game');

4. Cleanup #

// When app is closing
await DFHAnalytics.dispose();

How It Works #

  1. Register events in the DevFeedbackHub dashboard
  2. Add this SDK to your app
  3. Testers install your app via DevFeedbackHub
  4. Events are automatically tracked and matched to testers
  5. Testers earn credits when they complete goal events

Debug Logging #

Debug logging is enabled by default. You'll see output like:

DFHAnalytics: Initialized (request: abc-123, device: xxx-yyy)
DFHAnalytics: Events sent: 1
DFHAnalytics:   tester_matched: true
DFHAnalytics:   goal_completed: true (app_open)
DFHAnalytics:   credits_awarded: 3

To disable: DFHAnalytics.init('...', debug: false);

API Reference #

DFHAnalytics.init(requestId, {...}) #

Initialize the SDK. Must be called before track().

Parameter Type Required Description
requestId String Yes Your request ID from the dashboard
deviceId String? No Custom device ID (auto-generated if omitted)
onGoalCompleted Function? No Callback for one-time goal completion
onRecurringProgress Function? No Callback for recurring goal daily progress
debug bool No Enable debug logging (default: true)

DFHAnalytics.track(eventName, {...}) #

Track an event. Events are batched and sent every 5 seconds or when 20 events accumulate.

Parameter Type Required Description
eventName String Yes Event name (must match dashboard config)
data Map? No Additional event data
screenName String? No Screen where the event occurred

DFHAnalytics.flush() #

Manually send all queued events immediately.

DFHAnalytics.dispose() #

Flush remaining events and clean up resources.

License #

MIT

0
likes
160
points
87
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Lightweight analytics SDK for DevFeedbackHub - track tester behavior and goal completion in your app.

Homepage
Repository (GitHub)
View/report issues

Topics

#analytics #testing #feedback #beta-testing

License

MIT (license)

Dependencies

http

More

Packages that depend on devfeedbackhub_analytics