Respectlytics Respect lytics
Menu
πŸ€– Kotlin SDK v2.1.0

Privacy-First Kotlin Analytics

Jetpack Compose-ready analytics that respects your users. No GAID, no Android ID, no device fingerprintsβ€”just the insights you need without the privacy baggage.

MainActivity.kt
import com.respectlytics.sdk.Respectlytics

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Configure once on app start
        Respectlytics.configure(this, "YOUR_API_KEY")
        
        setContent {
            MyApp()
        }
    }
}

// Track from anywhere
Respectlytics.track("button_clicked")
2 lines
to integrate
5 fields
stored only
Kotlin
built-in types
0 device IDs
collected

Installation

Add the SDK to your Android project via Gradle

πŸ“¦ build.gradle.kts (Kotlin DSL)

Add JitPack repository and dependency:

// settings.gradle.kts

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

// app/build.gradle.kts

dependencies {
    implementation("com.github.respectlytics:respectlytics-kotlin:2.1.0")
}

πŸ“¦ build.gradle (Groovy DSL)

Traditional Groovy syntax:

// settings.gradle

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

// app/build.gradle

dependencies {
    implementation 'com.github.respectlytics:respectlytics-kotlin:2.1.0'
}

πŸ’‘ Tip: After adding the dependency, sync your project with Gradle files (File β†’ Sync Project with Gradle Files in Android Studio)

Firebase Analytics vs Respectlytics

Privacy-first analytics for Android developers who care about their users

Feature Firebase Analytics Respectlytics
GAID Collection βœ— Collects by default βœ“ Never collected
Android ID βœ— Can collect βœ“ Never collected
IP Storage βœ— Stored by default βœ“ Never stored
Session IDs Persistent βœ“ RAM-only, 2hr rotation
Data Fields Stored 25+ fields βœ“ 5 fields only
Integration Lines 10+ lines + plugin βœ“ 2 lines
Custom Properties ⚠️ Can leak PII βœ“ Rejected by API
Data Safety Form βœ— Complex disclosures βœ“ Minimal disclosures

Quick Start

Choose your Android UI framework

🎨 Jetpack Compose

Modern declarative UI with Compose:

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        // Configure once on app launch
        Respectlytics.configure(this, "YOUR_API_KEY")
    }
}

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MyAppTheme {
                HomeScreen()
            }
        }
    }
}

@Composable
fun HomeScreen() {
    Button(onClick = {
        Respectlytics.track("home_button_clicked")
    }) {
        Text("Click Me")
    }
}

πŸ“± Traditional Views

Classic XML layouts with View binding:

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        // Configure once on app launch
        Respectlytics.configure(this, "YOUR_API_KEY")
    }
}

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        findViewById<Button>(R.id.myButton)
            .setOnClickListener {
                Respectlytics.track("button_clicked")
            }
    }
}

πŸ“‹ Don't forget AndroidManifest.xml

Register your Application class:

<application
    android:name=".MyApp"
    android:label="@string/app_name"
    ...>
    <!-- Your activities -->
</application>

API Reference

Simple, intentional APIβ€”just 3 methods

configure(context, apiKey)

Initialize the SDK with your API key. Call once in your Application class.

Respectlytics.configure(this, "key")

track(eventName)

Track a named event. Events are batched and sent automatically.

Respectlytics.track("purchase")

flush()

Force send queued events immediately. Useful before app termination.

Respectlytics.flush()

No identify() method. No reset() method. By design.

Complete Jetpack Compose Example

Full working example with Material 3

MainActivity.kt
package com.example.myapp

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.respectlytics.sdk.Respectlytics

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Configure once (or in Application class)
        Respectlytics.configure(this, "YOUR_API_KEY")
        
        setContent {
            MaterialTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    AnalyticsDemo()
                }
            }
        }
    }
}

@Composable
fun AnalyticsDemo() {
    var clickCount by remember { mutableStateOf(0) }
    
    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(24.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ) {
        Text(
            text = "Clicked: $clickCount times",
            style = MaterialTheme.typography.headlineMedium
        )
        
        Spacer(modifier = Modifier.height(24.dp))
        
        Button(
            onClick = {
                clickCount++
                // Track button click
                Respectlytics.track("demo_button_clicked")
            },
            colors = ButtonDefaults.buttonColors(
                containerColor = MaterialTheme.colorScheme.primary
            )
        ) {
            Text("Track Event")
        }
        
        Spacer(modifier = Modifier.height(16.dp))
        
        OutlinedButton(
            onClick = {
                // Track different event
                Respectlytics.track("demo_secondary_action")
            }
        ) {
            Text("Secondary Action")
        }
    }
}

Automatic Behaviors

The SDK handles these automaticallyβ€”no configuration needed

πŸ”„

Session Rotation

IDs rotate every 2 hours and on app restart. Stored in RAM only.

πŸ“¦

Event Batching

Events are queued and sent efficiently to minimize network calls.

πŸ“΄

Offline Queuing

Events queue when offline and send automatically when connected.

πŸ”

Retry Logic

Failed requests retry with exponential backoff. No events lost.

Google Play Data Safety Form

How to accurately fill out Google Play's Data Safety section

βœ“ What We Collect

  • β€’ Approximate Location - Country only (derived from IP geo-lookup, IP not stored)
  • β€’ App Interactions - Event names and timestamps only

βœ— What We DON'T Collect

  • β€’ Device or other IDs - No GAID, no Android ID
  • β€’ Personal info - No names, emails, or user IDs
  • β€’ Precise location - No GPS or fine-grained location
  • β€’ Financial info - No payment or purchase data

Data Safety Form Answers

Device or other IDs: No
Location (Approximate): Yes (country only)
Personal info: No
Data shared with third parties: No
Data encrypted in transit: Yes (TLS/HTTPS)
Data deletion request: Available via dashboard

Privacy Architecture

Return of Avoidance (ROA): The best way to protect data is to never collect it

5 Fields Stored (Total)

1
event_name
The action being tracked
2
timestamp
When the event occurred
3
platform
"Android" (from SDK)
4
country
Derived from IP geo-lookup (IP not stored)

Never Collected

βœ— GAID
βœ— Android ID
βœ— Device fingerprint
βœ— IP address
βœ— Device model
βœ— OS version
βœ— User IDs
βœ— Custom properties
βœ— Screen resolution
βœ— Carrier info

Frequently Asked Questions

Does the Kotlin SDK collect GAID (Google Advertising ID)?
No. The Respectlytics Kotlin SDK never collects GAID, Android ID, device fingerprints, or any persistent identifiers. Session IDs are stored only in RAM and rotate every 2 hours or on app restart.
Does the SDK work with Jetpack Compose?
Yes! The SDK works seamlessly with both Jetpack Compose and traditional View-based UIs. Configure the SDK in your Application class's onCreate(), then call Respectlytics.track() from any composable or View.
What Android versions are supported?
The SDK supports Android 8.0 (API level 26) and higher. This covers approximately 95% of active Android devices. It works on both physical devices and emulators.
How do I fill out the Google Play Data Safety form?
For the Data Safety form, select: Device or other IDs = No, Location = Approximate (country only via IP geo-lookup, IP not stored), Personal info = No, Financial info = No. The SDK only stores 5 fields: event_name, session_id, timestamp, platform, and country.
Can I track custom properties with events?
By design, Respectlytics does not support custom properties. This prevents accidental PII leakageβ€”a common issue with analytics SDKs where developers inadvertently include user emails, names, or IDs in event properties. Use descriptive event names instead: premium_plan_selected rather than plan_selected with a plan: "premium" property.

Ready to Add Privacy-First Analytics?

Start tracking in under 5 minutes. 14-day free trial, no credit card required.

View on GitHub Β· All SDKs Β· Privacy Disclosure Guide