Code Monkey home page Code Monkey logo

dart_mp_analytics's Introduction

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.

dart_mp_analytics's People

Contributors

alvarobcprado avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

dart_mp_analytics's Issues

Upgrade uuid dependency

Hi, thank you so much for this project!
There are truly legitimate reasons why a flutter non iOS/Android/Web client would want to post events to Google Analytics, like purchase or purchase_refund from a branch, and Google is just ignoring us.
This package makes this a breeze!

Would you possibly consider bumping the uuid dependency from ^3.0.7 to ^4.2.1 ?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.