Realtime web analytics with privacy and simplicity at its core.
Go to https://digianalytics.fr/websites/new to register your app.
You need to choose a domain name or subdomain to associate your app with.
In this example, we will use https://app.example.com/
as website URL.
Add https://github.com/GroupeMINASTE/DigiAnalytics.git
to your Swift Package configuration (or using the Xcode menu: File
> Swift Packages
> Add Package Dependency
)
Add the following to your build.gradle
file:
repositories {
mavenCentral()
}
dependencies {
implementation 'me.nathanfallet.digianalytics:digianalytics:1.0.1'
}
Setup a shared instance of your analytics object:
import DigiAnalytics
extension DigiAnalytics {
static let shared = DigiAnalytics(baseURL: "https://app.example.com/")
}
Then, send requests where you want to get analytics (e.g. in a view controller viewDidAppear(_:)
)
// Will appear on dashbord as `https://app.example.com/home`
DigiAnalytics.shared.send(path: "home")
Setup a shared instance of your analytics object:
val analytics = DigiAnalytics("https://app.example.com/")
Then, send requests where you want to get analytics (e.g. in an activity onResume()
)
// Will appear on dashbord as `https://app.example.com/home`
analytics.send("home", this)