matomo_tracker 패키지는 Flutter 애플리케이션에 Matomo 분석을 완전히 크로스플랫폼으로 통합할 수 있는 솔루션을 제공합니다. 이 패키지는 Matomo 추적 API를 래핑하여 Android, iOS, 웹, macOS, Windows 및 Linux 플랫폼에서 사용자 행동 데이터를 수집할 수 있게 해줍니다. 간단한 초기화 및 이벤트 추적 메서드를 통해 사용자 정의 이벤트, 페이지 보기 및 사용자 세션 추적을 지원합니다. 기존 Matomo 설치와 원활하게 통합되도록 설계되어 플랫폼별 코드 없이 신뢰할 수 있는 데이터 수집이 가능합니다. 개인정보 보호 중심의 추적 방식을 유지하면서도 상세한 분석이 필요한 앱에 적합합니다.
If your application uses authentication and you wish to have your visitors including their specific identity to Matomo, you can use the Visitor property userId with any unique identifier from your back-end, by calling the setVisitorUserId() method. Here's an example on how to do it with Firebase:
If you want to offer a way for the user to opt out of analytics, you can use the setOptOut() call.
MatomoTracker.instance.setOptOut(optout: true);
Using Dimensions
If you want to track Visit or Action dimensions you can either use the trackDimensions (if
it's a Visit level dimension) or provide data in the optional dimensions param of trackEvent
(if it's an Action level dimension):
When using cookieless tracking, the user_id won't be sent or saved locally.
Dispatching
Actions logged are not send to Matomo immediately, but are queued for a configurable duration (defaulting to 10 seconds) before beeing send in batch. A user could terminate your app while there are still undispatched actions in the queue, which by default would be lost. The queue can be configured to be persistent so that such actions would then be send on the next app launch. See the DispatchSettings class for more configuration options.
Session class and its related properties firstVisit, lastVisit and visitCount have been removed as they were not used since Matomo 4.0.0.
LocalStorage methods getFirstVisit, setFirstVisit, getVisitCount and setVisitCount have been removed accordingly.
siteId is now a String instead of an int
v4.0.0
trackScreen was renamed to trackPageView and trackScreenWithName to trackPageViewWithName.
screenId and widgetId were renamed to pvId.
userId was renamed to uid.
traceName and widgetName were renamed to actionName.
traceTitle was renamed to eventName.
forcedId property has been removed as it was never used. You should rely on the user ID instead.
An object of type EventInfo has been added, it has the following properties: category, action, name and value, use it instead of passing the event name, action and value as separate parameters.
For TraceableClientMixin and TraceableWidget to work you will have to add the matomoObserver to your MaterialApp or WidgetsApp:
trackPageView positional parameter context is now a named parameter
trackGoal positional parameter goalId is now a named parameter: id
trackDimensions positional parameter dimensions is now a named parameter
trackCartUpdate positional parameters trackingOrderItems, subTotal, taxAmount, shippingCost and discountAmount are now named parameters
trackOrder positional parameters orderId (now id), trackingOrderItems, revenue (also became a double), subTotal, taxAmount, shippingCost and discountAmount are now named parameters
trackOutlink positional parameter link is now a named required parameter (also changed the type to String)
v3.0.0
Now the initialize() method takes a LocalStorage? localStorage instead of a SharedPreferences? prefs as its parameter to override the persistent data implementation.
By default it will use an implementation of shared_preferences with the class SharedPrefsStorage, but you can provide your own implementation of LocalStorage to use a different package.