Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkla320/tracking
A simple Interface for analysing app usage
https://github.com/kkla320/tracking
Last synced: 2 days ago
JSON representation
A simple Interface for analysing app usage
- Host: GitHub
- URL: https://github.com/kkla320/tracking
- Owner: kkla320
- License: mit
- Created: 2021-01-21T21:47:53.000Z (almost 4 years ago)
- Default Branch: develop
- Last Pushed: 2022-02-04T08:45:18.000Z (almost 3 years ago)
- Last Synced: 2023-03-10T07:05:46.568Z (almost 2 years ago)
- Language: Swift
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tracking
[![Swift](https://github.com/kkla320/Tracking/actions/workflows/swift.yml/badge.svg?branch=develop)](https://github.com/kkla320/Tracking/actions/workflows/swift.yml)
This package contains a unified API for analytics purposes.
## Installation
To install the analytics framework just add this line to the dependencies section in the Package.swift
```swift
.package(url: "https://github.com/kkla320/Tracking.git", from: "0.3.0")
```
After that you just need to add the package as a depency in the corresponding target.
```swift
.target(
name: "myProject",
dependencies: [
"Tracking"
])
```## How to use
First you have to import the framework
```swift
import Tracking
```At the start of your app, you have to initialize the Analytics system
```swift
let myAnalyticsHandler = // ...
let myAnalyticsFilter = // ...Analytics.bootstrap([myAnalyticsHandler], filters: [myAnalyticsFilter])
```The you can just call the shared instance of `Analytics`
```swift
let myEvent = // ...
Analytics.shared.log(event: myEvent)
```