분석 패키지는 플러터 플랫폼에서 여러 분석 서비스를 통합하고 관리하기 위한 유일한 인터페이스를 제공합니다. 사용자 행동과 앱 성능을 추적하는 것을 간소화하도록 설계되었으며, 다양한 분석 공급업체 간의 차이점을 추상화하여 개발자가 서비스를 쉽게 전환하거나 동시에 여러 서비스를 사용할 수 있도록 합니다. 이 라이브러리는 Android, iOS, macOS, Windows 및 Linux를 지원하여 일관된 데이터 수집이 필요한 크로스플랫폼 애플리케이션에 적합합니다. 단일 API를 통해 이벤트 로깅, 사용자 속성 추적 및 세션 관리가 가능합니다.
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:
Determine the actions that ought to be recorded in the analytics service:
At this moment, the current version of analytics is .
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.