搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫koa-health/mixpanel_analytics

mixpanel_analytics

一個用於 Flutter 應用程式的 Mixpanel REST API 的 Dart 包裝器。

mixpanel_analytics 專案封面
星標
19
分支
29
最近推送(UTC)
2023年8月18日
專案狀態
已封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Mixpanel Analytics

Build Status License: MIT Pub

A dart wrapper on the mixpanel REST API to be used in Flutter applications. As this is using the http REST API it works both with Android and iOS.

How to use it

There is an example app that demonstrates how to use the plugin,

You just need to instantiate the class and you'll be ready to send track or engage events.

Make sure to check mixpanel documentation for the REST API to know the options available.

MixpanelAnalytics(
  token: 'XXXXXXXXX',
  userId$: _user$.stream,
  verbose: true,
  ip: true,
  shouldAnonymize: true,
  shaFn: (value) => value,
  onError: (e) => setState(() {
    _error = e;
    _success = null;
  }),
);

There are two different constructors, the regular one which will send events on the fly and the batch mode which will group the requests (by type) and send them every X seconds (configurable).

MixpanelAnalytics.batch(
  token: 'XXXXXXXXX',
  userId$: _user$.stream,
  uploadInterval: Duration(seconds: 30),
  shouldAnonymize: true,
  shaFn: (value) => value,
  verbose: true,
  onError: (e) => setState(() {
    _error = e;
    _success = null;
  }),
);

Not supported yet

Check the documentation for more information on the features not yet supported https://developer.mixpanel.com/docs/http

Event Request Parameters

In addition to the data parameter, https://api.mixpanel.com/track supports a number of optional parameters. For the most part, these optional parameters are useful only in special situations.

Parameters
ip
redirect
img
callback
Update Request Parameters

In addition to the data parameter, https://api.mixpanel.com/engage supports a number of optional parameters. For the most part, these optional parameters are useful only in special situations.

Parameters
redirect
callback
Invalid requests

When sending batch requests, if one of them is invalid the whole batch operation will fail and the batch will be saved to retry the next iteration. This could become a problem as the whole batch could be stored and retried over and over. A strategy for this would be either to send individually the requests and ditch the only invalid one or just dith the whole lot (TBD).

Project Setup

This project is written in Flutter using the stable channel.

> flutter channel stable
> flutter upgrade
Install Dependencies
> flutter pub get
Build generated files (for Mockito)
> flutter pub run build_runner build --delete-conflicting-outputs

Note: During development this can be set to monitor for changes

> flutter pub run build_runner watch --delete-conflicting-outputs
Running tests
> flutter test --coverage
Koa Health GitHub avatar
GitHub 作者

Koa Health ↗

語言DartRubySwiftKotlinObjective-C

使用的依賴

依賴清單 6 項

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗