Skip to content

Commit

Permalink
Merge pull request #35 from aminekarimii/dev-maven-central
Browse files Browse the repository at this point in the history
Push analytiks to maven central
  • Loading branch information
aminekarimii committed Jul 16, 2023
2 parents 393faf2 + 1eac983 commit 1143ff0
Show file tree
Hide file tree
Showing 29 changed files with 339 additions and 413 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.iml
*.gpg
.gradle
/local.properties
/.idea
Expand Down
104 changes: 53 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
# <p align="center"> 📊Analytiks</p>
<p align="center">
<a href="https://github.com/skydoves/PowerSpinner/actions"><img alt="Build Status" src="https://github.com/aminekarimii/analytiks/workflows/Android%20CI/badge.svg"/></a>
<a href="https://jitpack.io/#aminekarimii/Analytiks"><img alt="JitPack version" src="https://jitpack.io/v/aminekarimii/Analytiks.svg"/></a>
</p>
# Analytiks

![Analytiks cover illustration](https://user-images.githubusercontent.com/20410115/228402805-3309d17a-0bc5-4404-90f8-20c9b30e33a9.png)
![Group 54 (1)](https://user-images.githubusercontent.com/20410115/228402805-3309d17a-0bc5-4404-90f8-20c9b30e33a9.png)

## ✏️ Description
An android library that centralizes analytics services in one place can be a useful tool for developers who want to track the usage and performance of their app.
Should be easy as it sounds, a single implementation to start with the base analytics core features, and then you can add each analytics service separately (to preserve library size).
## Description

An android library that centralizes analytics services in one place can be a useful tool for
developers who want to track the usage and performance of their app.
Should be easy as it sounds, a single implementation to start with the base analytics core features,
and then you can add each analytic service separately (to preserve library size).
A debug analytics mode that can log the same properties in the debug console.

![Scheme of the library logic](https://user-images.githubusercontent.com/20410115/225161402-d3a7d24f-da0d-4360-abab-fe86c68f0214.png)

## 📥 Download
Add it in your root ```build.gradle``` at the end of repositories:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
and in your app level ```build.gradle``` file, add:
[![Release](https://img.shields.io/maven-central/v/io.github.aminekarimii/analytiks)](https://img.shields.io/maven-central/v/io.github.aminekarimii/analytiks)

In your app level ```build.gradle``` file, add:

```gradle
dependencies {
implementation 'com.github.aminekarimii.analytiks:analytiks:{LATEST-VERSION}'
// You can add each addon separately as following:
implementation 'com.github.aminekarimii.analytiks:analytiks-googleanalytics:{LATEST-VERSION}' // Optional Firebase Analytics addon
implementation 'com.github.aminekarimii.analytiks:analytiks-segment:{LATEST-VERSION}' // Optional Segment addon
// Add any other optional addons here using this pattern:
// com.github.aminekarimii.analytiks:analytiks-<ADDON-NAME>:<LATEST-VERSION>
implementation 'io.github.aminekarimii:analytiks:VERSION'
implementation 'io.github.aminekarimii:analytiks-core:VERSION'
// You can add each Addon separately as following:
implementation 'io.github.aminekarimii:analytiks-addon-googleanalytics:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-mixpanel:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-timber:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-segment:VERSION'
}
```

## 🔌 Setup
1- In your activity, initiate the Analytiks library and keep an object to be used after as following:

1- In your activity, initiate the Analytiks library and keep an object to be used after as
following:

```kotlin
private lateinit var analytiks: Analytiks

Expand All @@ -54,42 +50,48 @@ override fun onCreate(savedInstanceState: Bundle?) {
analytiks = Analytiks(clients)
}
```

2- Initialize the addons

```kotlin
analytiks.initialize(this.applicationContext)
```

3- You're good to go!

```kotlin
analytiks.logEvent("your_event_name")
// ...
analytiks.pushAll()
```

## 🪄 Features
The list of features provided by the library
- **Initialization:** `init` Initialize the "analytiks" library, along with its sub-libraries, during the initialization process.
## Features [🚧 wip]

The list of features provided by the library

- **Initialization:** `init` Initialize the "analytiks" library, along with its sub-libraries,
during the initialization process.
- **Log event:** `event` send/save an event with a name and an optional set of properties.
- **Identify user:** `identify` Identify the current user by the given id or a random uuid in case of an empty one.
- **Identify user:** `identify` Identify the current user by the given id or a random uuid in case
of an empty one.
- **Set user property:** `setUserProperty` Sets a key value property to the identified user.
- **Reset:** `reset` the plugins and remove the default users configuration.
- **Flush events** `pushAll` send the recorded local data to the service servers on call.

## 🗃 Supported analytics SDKs
Here's a list of the most known analytics services that we will support in our library.
| Service | Status | Implementation | Official documentation |
| --------- | ------------- | -------------- | ------------ |
| Google/Firebase Analytics || <a href="./addon/analytiks-googleanalytics/README.md">Firebase/Google Addon doc</a> | <a href="https://firebase.google.com/docs/analytics/get-started?platform=android">Firebase Analytics doc</a> |
| Segment || <a href="./addon/analytiks-segment/README.md">Segment Addon doc</a> | <a href="https://segment.com/docs/connections/sources/catalog/libraries/mobile/kotlin-android/" >Segment doc</a> |
| Mixpanel || <a href="./addon/analytiks-mixpanel/README.md">Mixpanel Addon doc</a>| <a href="https://developer.mixpanel.com/docs/android">Mixpanel doc</a> |
| Flurry Analytics | 🚧 | - | - |
| Amplitude | 🚧 | - | - |
| App Annie | 🚧 | - | - |
| Localytics | 🚧 | - | - |
| AppsFlyer | 🚧 | - | - |
| App Center Analytics | 🚧 | - | - |
| Onesignal | 🚧 | - | - |
| Timber - For local event logging || - | <a href="https://github.com/JakeWharton/timber">github/JakeWharton/timber</a> |
| Your Custom Addon || - | <a href="./analytiks-core">Instructions</a> |
- **Flush events** `flush` send the recorded local data to the service servers on call.

## Supported analytics SDKs

Here's a list of the most known Analytic services that we will supoort in our library.

- [x] Google/Firebase Analytics
- [x] Segment
- [x] Mixpanel
- [ ] Flurry Analytics
- [ ] Amplitude
- [ ] App Annie
- [ ] Localytics
- [ ] AppsFlyer
- [ ] Sensor Tower
- [ ] Onesignal
- [x] Timber - For local event logging

➕ Can't find your service? [open an issue](https://github.com/aminekarimii/analytiks/issues/new) with the name and the direct documentation link in the comment section.

Expand Down
1 change: 0 additions & 1 deletion addon/analytiks-amplitude/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions addon/analytiks-amplitude/build.gradle

This file was deleted.

21 changes: 0 additions & 21 deletions addon/analytiks-amplitude/proguard-rules.pro

This file was deleted.

7 changes: 0 additions & 7 deletions addon/analytiks-amplitude/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 20 additions & 0 deletions addon/analytiks-azureinsight/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}
ext {
PUBLISH_GROUP_ID = 'io.github.aminekarimii'
PUBLISH_VERSION = '1.0.0'
PUBLISH_ARTIFACT_ID = 'analytiks-addon-azureinsight'
PUBLISH_DESCRIPTION = 'Analytics SDK'
PUBLISH_URL = 'https://github.com/aminekarimii/analytiks'
PUBLISH_LICENSE_NAME = 'Apache 2.0 License'
PUBLISH_LICENSE_URL =
'https://github.com/aminekarimii/analytiks/blob/dev/LICENSE'
PUBLISH_DEVELOPER_ID = 'aminekarimii'
PUBLISH_DEVELOPER_NAME = 'Amine Karimi'
PUBLISH_DEVELOPER_EMAIL = '[email protected]'
PUBLISH_SCM_CONNECTION =
'scm:git:github.com/aminekarimii/analytiks.git'
PUBLISH_SCM_DEVELOPER_CONNECTION =
'scm:git:ssh://github.com/aminekarimii/analytiks.git'
PUBLISH_SCM_URL =
'https://github.com/aminekarimii/analytiks/tree/master'
}
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
namespace 'com.analityks.addon.azureinsight'
Expand Down
31 changes: 0 additions & 31 deletions addon/analytiks-googleanalytics/README.md

This file was deleted.

20 changes: 20 additions & 0 deletions addon/analytiks-googleanalytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}
ext {
PUBLISH_GROUP_ID = 'io.github.aminekarimii'
PUBLISH_VERSION = '1.0.0'
PUBLISH_ARTIFACT_ID = 'analytiks-addon-googleanalytics'
PUBLISH_DESCRIPTION = 'Analytics SDK'
PUBLISH_URL = 'https://github.com/aminekarimii/analytiks'
PUBLISH_LICENSE_NAME = 'Apache 2.0 License'
PUBLISH_LICENSE_URL =
'https://github.com/aminekarimii/analytiks/blob/dev/LICENSE'
PUBLISH_DEVELOPER_ID = 'aminekarimii'
PUBLISH_DEVELOPER_NAME = 'Amine Karimi'
PUBLISH_DEVELOPER_EMAIL = '[email protected]'
PUBLISH_SCM_CONNECTION =
'scm:git:github.com/aminekarimii/analytiks.git'
PUBLISH_SCM_DEVELOPER_CONNECTION =
'scm:git:ssh://github.com/aminekarimii/analytiks.git'
PUBLISH_SCM_URL =
'https://github.com/aminekarimii/analytiks/tree/master'
}
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
namespace 'com.analytiks.addon.googleanalytics'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.analytiks.addon.googleanalytics
package com.analytiks.addon.mixpanel

import android.content.Context
import android.os.Bundle
Expand Down

0 comments on commit 1143ff0

Please sign in to comment.