FLUTTER ECOSYSTEM

poitch/dart-matomo

一個 Dart Matomo 客戶端

dart-matomo 專案封面
Stars
21
Forks
39
最近推送(UTC)
2023年8月8日
專案狀態
已封存
Jêrôme Poichet GitHub avatar
語言DartHTMLRubySwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 9 項

原始 README

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

展開 / 收合專案 README

matomo

A Dart Client for Matomo. This is completely written in Dart and works cross-platform, including web.

Getting Started

dependencies:
    matomo: ^1.1.0

As early as possible in your application, you need to configure the Matomo Tracker to pass the URL endpoint of your instance and your Site ID.

    await MatomoTracker().initialize(
        siteId: siteId,
        url: 'https://example.com/piwik.php',
    );

If you need to use your own Visitor ID, you can pass it at the initialization of MatomoTracker as is:

    await MatomoTracker().initialize(
        siteId: siteId,
        url: 'https://example.com/piwik.php',
        visitorId: 'customer_1',
    );

To track views simply replace StatelessWidget by TraceableStatelessWidget, StatefulWidget by TraceableStatefulWidget and finally InheritedWidget by TraceableInheritedWidget.

You can also optionally call directly trackScreen or trackScreenWithName to track a view.

For tracking goals and, events call trackGoal and trackEvent respectively.

A value can be passed for events:

MatomoTracker().trackEvent('eventName', 'eventAction', eventValue='eventValue');

Opting Out

If you want to offer a way for the user to opt out of analytics, you can use the setOptOut() call.

MatomoTracker().setOptOut(true);