flutter_umami 0.3.0 copy "flutter_umami: ^0.3.0" to clipboard
flutter_umami: ^0.3.0 copied to clipboard

Simple Umami Analytics Flutter SDK

Flutter Umami #

License: MIT

Simple Umami Analytics Flutter SDK made by Solvro Team

Installation 💻 #

❗ In order to start using Flutter Umami you must have the Flutter SDK installed on your machine.

Install via flutter pub add:

flutter pub add flutter_umami

Usage 🚀 #

Initialize Flutter Umami #

First, create an instance of FlutterUmami by calling the create method:

WidgetsFlutterBinding.ensureInitialized();
final umami = await FlutterUmami.create(
  url: 'https://my.analytics.server', // Your Umami instance URL
  id: '9f65dd3f-f2be-4b27-8b58-d76f83510beb', // Your site ID from Umami dashboard
  hostname: 'com.my.app', // Your app's hostname
  locale: 'en-US', // User's locale or get from the context or somewhere
  isEnabled: kIsRelease // recommended
);

Track Screen Views #

You can track screen views in two ways:

MaterialApp(
  navigatorObservers: [
    UmamiNavigationObserver(umami),
  ],
  // ... rest of your app configuration
);
await umami.trackScreenView(
  'home_screen',
  referrer: 'previous_screen', // Optional
);

Track Events #

Track custom events with optional values:

await umami.trackEvent(
  eventType: 'button_click',
  eventValue: 'sign_up', // Optional
  screenName: 'home_screen', // Optional
);

Credits #

Based on some discontinued package: https://pub.dev/packages/umami_tracker


1
likes
130
points
235
downloads

Publisher

verified publishersolvro.pl

Weekly Downloads

Simple Umami Analytics Flutter SDK

Documentation

API reference

License

MIT (license)

Dependencies

device_user_agent, dio, flutter

More

Packages that depend on flutter_umami