Skip to content

A lightweight Analytics library that logs events, identifies the user, and dispatches the data at one. πŸ“Š

License

Notifications You must be signed in to change notification settings

aminekarimii/analytiks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ŠAnalytiks

Build Status

Group 54 (1)

πŸ’­ Overview

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

πŸ“₯ Download

Release

In your app level build.gradle file, add:

dependencies {
    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:
private lateinit var analytiks: Analytiks

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    // ...
    analytiks = Analytiks.Builder()
        .addClient(CustomAnalytiksAddon())
        .addClient(MixpanelAnalyticsClient(token = "YOUR_TOKEN"))
        .addClient(
            SegmentAnalyticsClient(
                token = "YOUR_TOKEN",
                flushIntervalInSeconds = 5,
                trackApplicationLifecycleEvents = true,
            )
        )
}
  1. Initialize the addons
analytiks.initialize(this.applicationContext)
  1. You're good to go!
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.
  • 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.
  • Set user property: setUserProperty Sets a key value property to the identified user.
  • Reset: reset the plugins and remove the default user's configuration.
  • Flush events flush sends the recorded local data to the service servers on call.

πŸ” AnalytiksVisor

Events App Log Shortcut (expand) See what's happening in your app in real-time with Analytiks AppVisor. It's essentially your go-to for tracking events, serving as a local logger to make sure everything's logged just right, from the initialization to the events push with the exact date & time.

Key Features

  • Event Visualization: Easily view all recorded events within your application in a simple and intuitive UI.

🚧 Coming up

  • Event Sharing: Share specific events as text directly from the app visor, facilitating seamless collaboration among team members.
  • New Event Notifications: Receive notifications for new events to stay updated on your app's activity without constant manual checks.

Getting Started

To integrate this feature into your application, follow the steps below:

  1. Add Dependency: Ensure your build.gradle file includes the analytiks-addon-appvisor module as a dependency:
dependencies {
    implementation 'io.github.aminekarimii:analytiks-addon-appvisor:{LATEST_VERSION}'
}
  1. Initialization: Initialize AnalytiksVisor and add the interceptor to your Analytiks configuration:
Analytiks.Builder()
    .addInterceptor(AppVisorActivity.initialize())
    // ...
    .build()
  1. Create Shortcut: to create AnalytiksVisor Shortcut, add:
class AnalytiksApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        AnalytiksVisor.createShortcut(this)
    }
}

Video Demo

Screen_recording_20240305_234527.webm

πŸ—ƒ 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 βœ… Firebase/Google Addon doc Firebase Analytics doc
Segment βœ… Segment Addon doc Segment doc
Mixpanel βœ… Mixpanel Addon doc Mixpanel doc
Flurry Analytics 🚧 - -
Amplitude βœ… Amplitude Addon doc Amplitude doc
App Annie 🚧 - -
Localytics 🚧 - -
AppsFlyer 🚧 - -
App Center Analytics 🚧 - -
Onesignal 🚧 - -
Timber - For local event logging βœ… - github/JakeWharton/timber
Your Custom Addon βœ… - Instructions

βž• Can't find your service? open an issue with the name and the direct documentation link in the comment section.

πŸ“« Contact Information

For any questions, suggestions, or discussions regarding the "Analytiks" library, feel free to reach out through the following channels:

License πŸ”–

    Apache 2.0 License

    Copyright 2022 KARIMI Amine

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.