dart_mp_analytics 1.0.0 copy "dart_mp_analytics: ^1.0.0" to clipboard
dart_mp_analytics: ^1.0.0 copied to clipboard

A dart only package for wrapper around the Firebase Measurement Protocol API.

Dart MP Analytics

Pub.dev Badge GitHub Build Badge MIT License Badge Very Good Analysis Style Badge

A Dart package for tracking and logging events to Google Analytics using the Measurement Protocol.

Features #

  • Log events to Google Analytics Measurement Protocol
  • Support for different platforms (mobile, web, etc.)
  • Configurable options for API endpoints and settings
  • Add custom metadata to events
  • Debug mode for testing and validation of events before sending them to Google Analytics

Installation #

Add the following line to your pubspec.yaml file:

dependencies:
  dart_mp_analytics: ^1.0.0

Then, run flutter pub get to install the package.

Usage #

Import the package in your Dart code:

import 'package:dart_mp_analytics/dart_mp_analytics.dart';

Initialize the MPAnalytics instance with the desired options:

final mobileStreamOptions = MPAnalyticsOptions.mobileStream(
  firebaseAppId: 'your_firebase_app_id',
  appInstanceId: 'your_app_instance_id',
  apiSecret: 'your_api_secret',
);

final webStreamOptions = MPAnalyticsOptions.webStream(
  measurementId: 'your_measurement_id',
  clientId: 'your_client_id',
  apiSecret: 'your_api_secret',
);

final analytics = MPAnalytics(
  options: mobileStreamOptions // or webStreamOptions,
);

Log events using the logEvent method:

await analytics.logEvent('button_click');

For more advanced usage and customization, please refer to the package documentation.

Documentation #

Please refer to the API documentation for detailed information on the available classes and methods.

Contributions #

Contributions are welcome! If you find a bug or want to suggest an improvement, please open an issue or submit a pull request on the GitHub repository.

License #

This package is released under the MIT License. See the LICENSE file for more details.

4
likes
140
pub points
69%
popularity

Publisher

unverified uploader

A dart only package for wrapper around the Firebase Measurement Protocol API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http, logger, meta, mocktail, platform_info, uuid

More

Packages that depend on dart_mp_analytics