matomo-org/matomo-sdk-ios là dự án mã nguồn mở trên GitHub với 403 sao, viết chủ yếu bằng Swift. Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
The MatomoTracker is an iOS, tvOS and macOS SDK for sending app analytics to a Matomo server. MatomoTracker can be used from Swift and Objective-C.
Fancy help improve this SDK? Check this list to see what is left and can be improved.
Installation
The MatomoTracker can be installed via CocoaPods, Carthage and the Swift Package Manager. In every file you want to use the MatomoTracker, don't forget to import the framework with import MatomoTracker.
CocoaPods
Use the following in your Podfile.
pod 'MatomoTracker', '~> 7.8'
Then run pod install.
Carthage
Carthage is a non intrusive way to install MatomoTracker to your project. It makes no changes to your Xcode project and workspace. Add the following to your Cartfile:
github "matomo-org/matomo-sdk-ios"
Swift Package Manager
You can use the Swift Package Manager as integration method. If you want to use the Swift Package Manager as integration method, either use Xcode to add the package dependency or add the following dependency to your Package.swift:
The Matomo iOS SDK doesn't provide a instance of the PiwikTracker. In order to be able to track data you have to create an instance first.
let matomoTracker = MatomoTracker(siteId: "23", baseURL: URL(string: "https://demo2.matomo.org/piwik.php")!)
The siteId is the ID that you can get if you add a website within the Matomo web interface. The baseURL it the URL to your Matomo web instance and has to include the "piwik.php" or "matomo.php" string.
You can either pass around this instance, or add an extension to the MatomoTracker class and add a shared instance property.
The siteId is the ID that you can get if you add a website within the Matomo web interface. The baseURL is the URL to your Matomo web instance and has to include the "piwik.php" or "matomo.php" string.
You can use multiple instances within one application.
Opting Out
The MatomoTracker SDK supports opting out of tracking. Please use the isOptedOut property of the MatomoTracker to define if the user opted out of tracking.
matomoTracker.isOptedOut = true
Tracking Page Views
The MatomoTracker can track hierarchical screen names, e.g. screen/settings/register. Use this to create a hierarchical and logical grouping of screen views in the Matomo web interface.
This will log that the user slid the volume slider on the player to 35.1%.
Tracking search
The MatomoTracker can track how users use your app internal search. You can track what keywords were searched for, what categories they use, the number of results for a certain search and what searches resulted in no results.
matomoTracker.trackSearch(query: "Best mobile tracking", category: "Technology", resultCount: 15)
Custom Dimension
The Matomo SDK currently supports Custom Dimensions for the Visit Scope. Using Custom Dimensions you can add properties to the whole visit, such as "Did the user finish the tutorial?", "Is the user a paying user?" or "Which version of the Application is being used?" and such. Before sending custom dimensions please make sure Custom Dimensions are properly installed and configured. You will need the ID of your configured Dimension.
Dimensions in the Visit Scope will be sent along every Page View or Event. Custom Dimensions are not persisted by the SDK and have to be re-configured upon application startup.
Custom User ID
To add a custom User ID, simply set the value you'd like to use on the userId field of the tracker:
matomoTracker.userId = "coolUsername123"
All future events being tracked by the SDK will be associated with this userID, as opposed to the default UUID created for each Visitor.
Custom Visitor ID persisted on app starts
MatomoTracker will generate an _id upon first usage and will use this value to recognize the current visitor. This _id is persisted over app starts.
If you want to set your own visitor id, you can set your own visitor id with the forcedVisitorId field. Make sure you use a 16 character long hexadecimal string. The forcedVisitorId is persisted over app starts.
The MatomoTracker will dispatch events every 30 seconds automatically. If you want to dispatch events manually, you can use the dispatch() function.
Session Management
The MatomoTracker starts a new session whenever the application starts. If you want to start a new session manually, you can use the startNewSession() function. You can, for example, start a new session whenever the user enters the application.
You can also write your own Logger and send the logs wherever you want. Just write a new class/struct and let it conform to the Logger protocol.
Custom User Agent
The MatomoTracker will create a default user agent derived from the WKWebView user agent.
You can instantiate the MatomoTracker using your own user agent.
let matomoTracker = MatomoTracker(siteId: "5", baseURL: URL(string: "http://your.server.org/path-to-matomo/piwik.php")!, userAgent: "Your custom user agent")
Sending custom events
Instead of using the convenience functions for events and screen views for example you can create your event manually and even send custom tracking parameters. This feature isn't available from Objective-C.
All custom events will be URL-encoded and dispatched along with the default Event parameters. Please read the Tracking API Documentation for more information on which parameters can be used.
Also: You cannot override Custom Parameter keys that are already defined by the Event itself. If you set those keys in the customTrackingParameters they will be discarded.
Automatic url generation
You can define the url property on every Event. If none is defined, the SDK will try to generate a url based on the contentBase of the MatomoTracker. If the contentBase is nil, no url will be generated. If the contentBase is set, it will append the actions of the event to it and use it as the url. Per default the contentBase is generated using the application bundle identifier. For example http://org.matomo.skd. This will not result in resolvable urls, but enables the backend to analyse and structure them.
Event dispatching
Whenever you track an event or a page view it is stored in memory first. In every dispatch run a batch of those events are sent to the server. If the device is offline or the server doesn't respond these events will be kept and resent at a later time. Events currently aren't stored on disk and will be lost if the application is terminated. #137. You can use an experimental implementation of a Queue that stores all Events in the UserDefaults.
let queue = UserDefaultsQueue(userDefaults: UserDefaults.standard)
let dispatcher = URLSessionDispatcher(baseURL: URL(string: "https://example.com/matomo.php")!)
let matomoTracker = MatomoTracker(siteId: "1", queue: queue, dispatcher: dispatcher)
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/matomo-org/matomo-sdk-ios là nguồn chính thức.
matomo-org/matomo-sdk-ios có bao nhiêu sao?
matomo-org/matomo-sdk-ios có 403 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/matomo-org/matomo-sdk-ios. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
matomo-org/matomo-sdk-ios có những chủ đề gì?
GitHub topics của matomo-org/matomo-sdk-ios: "hacktoberfest". TopGit xếp repo vào nhóm mã nguồn mở.
matomo-org/matomo-sdk-ios có phải mã nguồn mở không?
Có — matomo-org/matomo-sdk-ios phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/matomo-org/matomo-sdk-ios.
matomo-org/matomo-sdk-ios có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho matomo-org/matomo-sdk-ios. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
matomo-org/matomo-sdk-ios còn đang phát triển không?
Commit gần nhất trên matomo-org/matomo-sdk-ios là 4 tháng trước (theo timestamp GitHub). Repo có 170 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về matomo-sdk-ios?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về matomo-sdk-ios.