Skip to content

kkla320/Tracking

Repository files navigation

Tracking

Swift

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

.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.

.target(
    name: "myProject",
    dependencies: [
        "Tracking"
    ])

How to use

First you have to import the framework

import Tracking

At the start of your app, you have to initialize the Analytics system

let myAnalyticsHandler = // ...
let myAnalyticsFilter = // ...

Analytics.bootstrap([myAnalyticsHandler], filters: [myAnalyticsFilter])

The you can just call the shared instance of Analytics

let myEvent = // ...
Analytics.shared.log(event: myEvent)

About

A simple Interface for analysing app usage

Resources

License

Stars

Watchers

Forks

Languages