Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.appstack.tech/llms.txt

Use this file to discover all available pages before exploring further.

Use Cursor, Claude Code, or another AI to help you integrate the Android (Kotlin) SDK.

CursorOpen in Cursor

Appstack ID and attribution params

After configure, you can read the Appstack user ID and the attribution map for partner integrations (for example Superwall, RevenueCat).
val appstackId = AppstackAttributionSdk.getAppstackId()
val attributionParams = AppstackAttributionSdk.getAttributionParams()
  • getAppstackId() — Appstack user identifier when a partner expects $appstackId or similar.
  • getAttributionParams() — Attribution payload (campaign, media source, click IDs, device identifiers where available) to forward to partners.

Maven Central repository

Here, you will find the Maven Central Android SDK documentation. Please, use the latest version of the SDK available.

Requirements

  1. Minimum SDK: Android 5.0 (API level 21).
  2. Target SDK: 34+
  3. Java Version: 8+
  4. Gradle: 7.0+

Initial setup

1

Installation

Add the SDK dependency to your app’s build.gradle.kts:
dependencies {
    // Resolve latest from Maven Central, then prefer pinning an explicit version for release builds.
    implementation("tech.appstack.android-sdk:appstack-android-sdk:+")
}
No additional configuration needed - the SDK will work automatically after installation.
2

Initialization

Follow these steps to get the API key:
  1. In Appstack, from the side menu, select SDK and ensure you are selecting the correct application.
  2. Select the Production environment.
  3. Copy the API key.
Examples:Configure the SDK in your Application class:
import com.appstack.attribution.AppstackAttributionSdk
import com.appstack.attribution.EventType

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        
        AppstackAttributionSdk.configure(
            context = this,
            apiKey = "your-android-api-key"
        )
    }
}
3

Configuration parameters

Initialize the SDK with your API key. Must be called in Application.onCreate() before any other SDK methods.
Parameters:
  • context Application context.
  • apiKey (String, required): Your Appstack API key.
  • isDebug  (Bool, default: false): Leave as ‘false’ for production. See Development setup if you need to test against the development environment.
  • logLevel (LogLevel, default: Loglevel.INFO): Logging level for debugging.
Example:
AppstackAttributionSdk.configure(
    context = this,
    apiKey = "your-api-key",
    isDebug = BuildConfig.DEBUG,
    logLevel = LogLevel.INFO
)
4

Sending events

Track user actions and revenue in your activities:
// Track events without parameters
AppstackAttributionSdk.sendEvent(EventType.SIGN_UP)
AppstackAttributionSdk.sendEvent(EventType.LOGIN)

// Track events with parameters (including revenue)
AppstackAttributionSdk.sendEvent(
    EventType.PURCHASE, 
    parameters = mapOf("revenue" to 29.99, "currency" to "USD")
)

// Custom events
AppstackAttributionSdk.sendEvent(
    EventType.CUSTOM,
    name = "user_attributes",
    parameters = mapOf(
		"email" to "test@example.com",
		"name" to "first_name last_name", 
		"phone_number" to "+33060000000", 
		"date_of_birth" to "2026-02-01" 
	)
)
Available EventType valuesIt is recommended to use standard events for a smoother experience.
EventType.INSTALL is tracked automatically on SDK initialization. Do not send it manually.
  • EventType.LOGIN  User login.
  • EventType.SIGN_UP / EventType.REGISTER User registration.
  • EventType.PURCHASE Purchase transactions.
  • EventType.SUBSCRIBE Subscription events.
  • EventType.ADD_TO_WISHLIST, EventType.INITIATE_CHECKOUT E-commerce events.
  • EventType.START_TRIAL Trial start.
  • EventType.LEVEL_START/ EventType.LEVEL_COMPLETE Game progression.
  • EventType.TUTORIAL_COMPLETE, EventType.SEARCH, EventType.SHARE  Engagement events.
  • EventType.CUSTOM For any other custom events.
Tracks custom events with optional parameters:
  • event Event type from EventType enum (required).
  • name Event name for custom events (optional, required when event is CUSTOM).
  • parameters - Optional map of parameters (e.g., mapOf("revenue" to 29.99, "currency" to "USD")).
Enhanced app campaigns
When running enhanced app campaigns (EACs), it is highly recommended to send multiple parameters with the in-app event to improve matching quality.
For any event that represents revenue, we recommend sending:
  1. revenue or price (number).
  2. currency (string, e.g. EUR, USD).
AppstackAttributionSdk.sendEvent(
    EventType.PURCHASE,
    parameters = mapOf("revenue" to 4.99, "currency" to "EUR")
)
To improve matching quality on Meta, send events including the following parameters if you can fulfill them:
  1. email.
  2. name (first + last name in the same field).
  3. phone_number.
  4. date_of_birth (recommended format: YYYY-MM-DD).

Limitations

Platform constraints

  • Android 5.0+ required (API level 21).
  • Attribution only works for Play Store installations.
  • Network connectivity required for event transmission (with offline queueing).

Event tracking

  • The SDK must be initialized in Application.onCreate() before tracking calls.
  • Custom event names should be descriptive and consistent.
  • The debug overlay is only available when isDebug = true.

Development setup

If you want to test the SDK against the Appstack development environment before shipping, follow these extra steps:
  1. In Appstack, from the side menu, select SDK, switch to the Development environment, and copy the Development API key. This key is separate from your production key.
  2. In your configure(...) call, use the development key and set isDebug = true:
AppstackAttributionSdk.configure(
    context = this,
    apiKey = "your_development_api_key",
    isDebug = true,
    logLevel = LogLevel.DEBUG
)
The isDebug flag must match the key you’re using: development key with isDebug = true, production key with isDebug = false. The flag tells the SDK which environment URL to route to. Debug mode Shows debug overlay with SDK status and event information. Only works when isDebug = true. Example:
if (BuildConfig.DEBUG) {
    AppstackAttributionSdk.showDebugOverlay(this)
}

Superwall

To start using the Superwall integration, click here to see the correct SDK documentation.

Support

For questions or issues:
  1. Check the GitHub Repository.
  2. Contact our support team at support@appstack.tech
  3. Open an issue in the repository.

Use Cursor, Claude Code, or another AI to Validate your existing implementation of the Appstack Android SDK (Kotlin) integration.

CursorOpen in Cursor