Blue Triangle Help Center
Auto Light Dark
Auto Light Dark

Quick Start Guide for instrumenting Android Mobile Applications

Please refer to the complete instrumentation guide for a complete reference, release notes etc.

1. Install the SDK

Add the JitPack repository

Add to your project-level build.gradle:

allprojects {
    repositories {
        // ...
        maven { url "https://jitpack.io" }
    }
}

or to settings.gradle (recommended):

dependencyResolutionManagement {
    repositories {
        // ...
        maven { url "https://jitpack.io" }
    }
}

Add the SDK dependency

dependencies {
    implementation("com.github.blue-triangle-tech:btt-android-sdk:2.18.4")
}

If you’re using Gradle Plugin 8.2.0+, exclude the okhttp-bom to avoid conflicts:

implementation("com.github.blue-triangle-tech:btt-android-sdk:2.18.4") {
    exclude("com.squareup.okhttp3", "okhttp-bom")
}

2. Configure Your Site ID

Add your Site ID to the app manifest:

<meta-data
    android:name="com.blue-triangle.site-id"
    android:value="<BTT_SITE_ID>" />

Replace <BTT_SITE_ID> with your actual site ID.


3. Initialize the SDK

Initialize tracking from your Application class:

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Tracker.init(this)
    }
}

4. Track Checkout Events

Use a Timer to capture checkout actions such as brand value, cart value, order number, and cart count.

Brand value example:

val timer = Timer()
timer.start()
timer.setPageName("SignUp")
timer.setBrandValue(99.99)
timer.submit()

Cart + order example:

val timer = Timer()
timer.start()
timer.setPageName("Confirmation")
timer.setCartValue(99.99)
timer.setOrderNumber("XYZ1234")
timer.setCartCount(2)
timer.setCartCountCheckout(5)
timer.setOrderTime(System.currentTimeMillis()) // optional
timer.submit()

Track Compose views

To automatically track Compose screens, use the BlueTriangle Gradle plugin explained here.