Skip to content

Commit

Permalink
Add installation & usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfallet committed May 15, 2021
1 parent ff6ff26 commit 6b36b03
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@
[![Pull Requests](https://img.shields.io/github/issues-pr/GroupeMINASTE/DigiAnalytics)]()
[![Code Size](https://img.shields.io/github/languages/code-size/GroupeMINASTE/DigiAnalytics)]()


Realtime web analytics with privacy and simplicity at its core.

## Installation

Add `https://github.com/GroupeMINASTE/DigiAnalytics.git` to your Swift Package configuration (or using the Xcode menu: `File` > `Swift Packages` > `Add Package Dependency`)

## Register your app

Go to [https://digianalytics.fr/websites/new](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.

## Usage

Before sending any request, set your app website URL:

```swift
DigiAnalytics.shared.baseURL = "https://app.example.com/"
```

Then, send requests where you want to get analytics (e.g. in a view controller `viewDidAppear(_:)`)

```swift
// TODO
DigiAnalytics.shared.send(path: "home") // Will appear on dashbord as `https://app.example.com/home`
```

0 comments on commit 6b36b03

Please sign in to comment.