カテゴリー・パッケージ・リポジトリを検索

パッケージ詳細v2.0.3

analytics

分析サービスと連携するためのインターフェース。このライブラリは、さまざまな分析サービスとの作業を統一することを目的としています。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
936
いいね数
43
Pub ポイント
150

パッケージをインストール

flutter pub add analytics

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

アナリティクスパッケージは、Flutterプラットフォーム間で複数の分析サービスを統合および管理するための統一インターフェースを提供します。ユーザー行動とアプリのパフォーマンスを効率的に追跡することを目的としており、さまざまな分析プロバイダー間の違いを抽象化することで、開発者が簡単にサービスを切り替えたり、複数のサービスをシームレスに利用できるようにしています。このライブラリはAndroid、iOS、macOS、Windows、Linuxをサポートしており、一貫したデータ収集が必要なクロスプラットフォームアプリに最適です。単一のAPIを通じてイベントログの記録、ユーザープロパティの追跡、セッション管理が可能になります。

用途

  • クロスプラットフォーム分析統合
  • 複数のプロバイダーにわたる統合イベント追跡
  • ユーザー行動モニタリング
  • アプリのパフォーマンス測定
  • A/Bテストデータ収集

主な機能

  • プラットフォームに依存しない分析インターフェース
  • 複数のアナリティクスバックエンドのサポート
  • プラットフォーム間で一貫した API
  • サービスの切り替えが簡単
  • イベントおよびユーザー属性のトラッキング

適している対象

  • マルチプラットフォームアプリを開発する開発者
  • 複数の分析ツールを使用するチーム
  • 柔軟な分析構成を必要とするプロジェクト
  • 詳細なユーザーインサイトが必要なアプリ
  • スタートアップが早期に分析を標準化する

注意事項

  • 個別のアナリティクスプロバイダーのセットアップが必要です
  • 追加の依存関係によりアプリサイズが増加する可能性があります
  • プロバイダ固有の実装詳細に依存
  • プライバシーおよび同意の慎重な取り扱いが必要です
  • 下位のプロバイダーがサポートする機能に制限される

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Analytics

Made by Surf 🏄‍♂️🏄‍♂️🏄‍♂️

Build Status Coverage Status Pub Version Pub Likes Pub popularity Flutter Platform

Overview

Interface for working with analytic services. The library is supposed to unify work with various analytic services. The main actors are:

  • AnalyticAction — any action that is valuable for analytics. Usually it is a "button pressed" or "screen opened" type of event but the main criterion is a possibility to be handled by AnalyticStrategy.
  • AnalyticActionPerformer - an interface for analytic action performers. This class is an abstract base class for analytic strategies.
  • AnalyticStrategy — a class that provides a special way to send an analytical action. To create a custom analytic strategy, you should extend this class and implement the performAction method.
  • AnalyticService — a class that provides a way to send analytic action using a set of analytic strategies. To use this class, you should create an instance of it with a set of analytic strategies, and then call the performAction method to send analytic action.

Example

The easiest interaction with the library is as follows:

  1. Determine the actions that ought to be recorded in the analytics service:

    class MyAnalyticAction implements AnalyticAction {
        final String key;
        final String value;
    
        MyAnalyticAction(this.key, this.value);
    }
    
    class ButtonPressedAction extends MyAnalyticAction {
        ButtonPressedAction() : super("button_pressed", null);
    }
    
    class ScreenOpenedAction extends MyAnalyticAction {
        ScreenOpenedAction({String param}) : super("screen_opened", param);
    }
    
  2. Implement analytic strategy:

    class MyAnalyticStrategy
        extends AnalyticStrategy<MyAnalyticAction> {
        final SomeAnalyticsApi _analyticsApi;
    
        SomeAnalyticsApi(this._analyticsApi);
    
        @override
        void performAction(MyAnalyticAction action) {
            _analyticsApi.send(action.key, action.value);
        }
    }
    
  3. Create an AnalyticService with your strategy:

    final analyticService = AnalyticService.withStrategies({
        MyAnalyticStrategy(analytics),
    });
    

Usage:

    analyticService.performAction(ButtonPressedAction());

Installation

Add analytics to your pubspec.yaml file:

dependencies:
  analytics: $currentVersion$

At this moment, the current version of analytics is analytics version.

Migrating from 1.x.x to 2.x.x

1.x.x

    final analyticService = DefaultAnalyticService();
    analyticService.addActionPerformer(
        MyAnalyticActionPerformer(SomeAnalyticService()),
    );

Starting from version 2.0.0, sending an event to a specific analytics service is implemented using strategies. The AnalyticService class stores these strategies. Implement analytics strategies using the AnalyticStrategy egy class.

    final analyticService = AnalyticService.withStrategies({
        MyAnalyticStrategy(analytics),
    });

Changelog

All notable changes to this project will be documented in this file.

Issues

To report your issues, submit directly in the Issues section.

Contribute

If you would like to contribute to the package (e.g. by improving the documentation, fixing a bug or adding a cool new feature), please read our contribution guide first and send us your pull request.

Your PRs are always welcome.

How to reach us

Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.

Telegram

License

Apache License, Version 2.0

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト