aminekarimii/analytiks
aminekarimii/analytiks has 82 GitHub stars and 3 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-13 03:38 UTC. Last push 2025-10-24.
A lightweight Analytics library that logs events, identifies the user, and dispatches the data at one. 📊
可以做什么
- 🔧 Easy Integration - Single API for multiple analytics services
- 📦 Modular Design - Add only the providers you need
- 🐛 Debug Mode - Console logging for development
- 🚀 Performance Optimized - Minimal overhead and smart batching
实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文📊 Analytiks
A unified Android analytics library that centralizes multiple analytics services
📋 Table of Contents
- Overview
- Key Features
- Installation
- Quick Start
- Core Features
- Supported Analytics SDKs
- AnalytiksVisor - Event Monitoring
- Advanced Usage
- Contributing
- Contact
- License
💭 Overview
Analytiks is a powerful Android library designed to simplify analytics integration by centralizing multiple analytics services into a single, unified interface. Instead of managing multiple SDKs and their different APIs, Analytiks provides a consistent way to track events, identify users, and manage analytics across your entire application.
Why Analytiks?
- Single Implementation: Write once, use with multiple analytics providers
- Modular Architecture: Add only the analytics services you need
- Debug-Friendly: Built-in logging for development and testing
- Lightweight: Minimal impact on your app's size and performance
- Easy Migration: Switch between analytics providers without code changes
✨ Key Features
- 🔧 Easy Integration - Single API for multiple analytics services
- 📦 Modular Design - Add only the providers you need
- 🐛 Debug Mode - Console logging for development
- 🚀 Performance Optimized - Minimal overhead and smart batching
- 🔄 Provider Agnostic - Switch providers without changing your code
- 📱 Real-time Monitoring - Built-in event viewer with AnalytiksVisor
Option 1: Using BOM (Recommended)
The BOM (Bill of Materials) automatically includes core modules and manages versions:
dependencies {
// Import the BOM - automatically includes analytiks-core and analytiks
implementation platform('io.github.aminekarimii:analytiks-bom:1.4.0')
// Add addons as needed (without version numbers)
implementation 'io.github.aminekarimii:analytiks-appsflyer'
implementation 'io.github.aminekarimii:analytiks-addon-amplitude'
implementation 'io.github.aminekarimii:analytiks-addon-googleanalytics'
implementation 'io.github.aminekarimii:analytiks-addon-mixpanel'
implementation 'io.github.aminekarimii:analytiks-addon-sentry'
implementation 'io.github.aminekarimii:analytiks-addon-timber'
implementation 'io.github.aminekarimii:analytiks-addon-segment'
}
Option 2: Manual Version Management
If you prefer to manage versions manually:
dependencies {
// Core libraries
implementation 'io.github.aminekarimii:analytiks:1.4.0'
implementation 'io.github.aminekarimii:analytiks-core:1.4.0'
// Analytics Providers (Add as needed)
implementation 'io.github.aminekarimii:analytiks-addon-googleanalytics:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-mixpanel:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-segment:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-amplitude:1.4.0'
implementation 'io.github.aminekarimii:analytiks-appsflyer:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-sentry:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-timber:1.4.0'
implementation 'io.github.aminekarimii:analytiks-addon-appvisor:1.4.0'
}
Note: Check Maven Central for the latest version.
🚀 Quick Start
1. Initialize Analytiks
In your Activity or Application class:
class MainActivity : AppCompatActivity() {
private lateinit var analytiks: Analytiks
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Build your analytics configuration
analytiks = Analytiks.Builder()
.addClient(GoogleAnalyticsClient()) // Firebase Analytics
.addClient(MixpanelAnalyticsClient(token = "YOUR_MIXPANEL_TOKEN"))
.addClient(
SegmentAnalyticsClient(
token = "YOUR_SEGMENT_TOKEN",
flushIntervalInSeconds = 5,
trackApplicationLifecycleEvents = true
)
)
.addClient(TimberAnalyticsClient()) // For debug logging
.build()
}
}
2. Initialize the Library
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// ... configuration above
// Initialize all configured analytics providers
analytiks.initialize(applicationContext)
}
3. Start Tracking Events
// Track a simple event
analytiks.logEvent("user_signup")
// Track an event with properties
analytiks.logEvent(
eventName = "purchase_completed",
properties = mapOf(
"product_id" to "12345",
"price" to 29.99,
"currency" to "USD"
)
)
// Identify a user
analytiks.identify(userId = "user_12345")
// Set user properties
analytiks.setUserProperty("subscription_type", "premium")
// Send all queued events immediately
analytiks.pushAll()
🔧 Core Features
Event Tracking
// Simple event
analytiks.logEvent("button_clicked")
// Event with custom properties
analytiks.logEvent("video_played", mapOf(
"video_id" to "abc123",
"duration" to 120,
"quality" to "HD"
))
User Management
// Identify user with custom ID
analytiks.identify("user_12345")
// Identify with auto-generated UUID
analytiks.identify()
// Set user properties
analytiks.setUserProperty("age", 25)
analytiks.setUserProperty("plan", "premium")
Data Management
// Force send all queued events
analytiks.flush()
// Reset user data and clear queue
analytiks.reset()
🗃 Supported Analytics SDKs
| Service | Status | Implementation Guide | Official Documentation |
|---|---|---|---|
| Google Analytics/Firebase | ✅ Available | Setup Guide | Firebase Docs |
| Segment | ✅ Available | Setup Guide | Segment Docs |
| Mixpanel | ✅ Available | Setup Guide | Mixpanel Docs |
| Amplitude | ✅ Available | Setup Guide | Amplitude Docs |
| AppsFlyer | ✅ Available | Setup Guide | AppsFlyer Docs |
| Sentry | ✅ Available | Setup Guide | Sentry Docs |
| Timber (Local Logging) | ✅ Available | Built-in | Timber GitHub |
| Custom Analytics | ✅ Available | Create Custom Addon | - |
| Flurry Analytics | 🚧 Coming Soon | - | - |
| CleverTap | 🚧 Coming Soon | - | - |
| MoEngage | 🚧 Coming Soon | - | - |
| Adjust | 🚧 Coming Soon | - | - |
Request New Integrations
Can't find your analytics service? Open an issue with the service name and documentation link.
🔍 AnalytiksVisor - Event Monitoring
AnalytiksVisor provides real-time event monitoring and debugging capabilities, allowing you to see exactly what analytics events are being tracked in your application.
Features
- 📊 Real-time Event Visualization - Monitor events as they happen
- 🕐 Timestamp Tracking - Precise event timing information
- 📋 Event Details - Complete event properties and metadata
- 🚧 Coming Soon: Event sharing and push notifications
Setup
- Add the dependency:
Using BOM (Recommended):
dependencies {
implementation platform('io.github.aminekarimii:analytiks-bom:1.4.0')
implementation 'io.github.aminekarimii:analytiks-addon-appvisor'
}
Or with manual version:
implementation 'io.github.aminekarimii:analytiks-addon-appvisor:1.4.0'
- Initialize with interceptor:
analytiks = Analytiks.Builder()
.addInterceptor(AppVisorActivity.initialize())
.addClient(/* your analytics clients */)
.build()
- Create app shortcut (optional):
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
AnalytiksVisor.createShortcut(this)
}
}
Demo
🔨 Advanced Usage
You can create custom analytics providers by implementing the AnalyticsClient interface:
class CustomAnalyticsClient : AnalyticsClient {
override fun initialize(context: Context) {
// Initialize your custom analytics SDK
}
override fun logEvent(eventName: String, properties: Map<String, Any>?) {
// Implement event logging
}
override fun identify(userId: String) {
// Implement user identification
}
override fun setUserProperty(key: String, value: Any) {
// Implement user property setting
}
override fun flush() {
// Implement force flush
}
override fun reset() {
// Implement reset functionality
}
}
Debug Mode
Enable debug logging in development builds:
analytiks = Analytiks.Builder()
.addClient(TimberAnalyticsClient()) // Logs to console
.build()
🤝 Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
git clone https://github.com/aminekarimii/analytiks.git
cd analytiks
./gradlew build
📫 Contact
Amine Karimi - Library Creator & Maintainer
- 📧 Email: [email protected]
- 💼 LinkedIn: aminekarimi
- 🐦 Twitter: @aminekarimii
- 🐙 GitHub: aminekarimii
📄 License
Apache License 2.0
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.
⭐ If you find Analytiks helpful, please consider giving it a star on GitHub! ⭐
探索相关项目
Asabeneh/30-Days-Of-Python
30 Days of Python 编程挑战是一份循序渐进的指南,用于在 30 天内学习 Python 编程语言。这项挑战可能需要超过 100 天。请按自己的节奏进行。这些视频或许也有帮助:https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,618 星标grafana/grafana
开放且可组合的可观测性与数据可视化平台。可对来自 Prometheus、Loki、Elasticsearch、InfluxDB、Postgres 等众多数据源的指标、日志和追踪进行可视化。
77,859 星标redis/redis
对于正在构建实时数据驱动应用的开发者而言,Redis 是首选、速度最快且功能最丰富的缓存、数据结构服务器和文档与向量查询引擎。
77,472 星标apache/superset
Apache Superset 是一个数据可视化与数据探索平台
75,495 星标