Integration
Android SDK integration
Gradle dependencies, Application init, signing allowlist, and first-session verification.
Measure native Activities, Fragments, and Jetpack Compose with the same Tracuto project, replay, and friction analysis.
1. Choose Android on Complete Setup
In the dashboard, open Complete setup and select Android app as your measurement surface. This locks verification to mobile ingest for this project.
2. Add Gradle dependencies and initialize
Add the Tracuto Maven artifacts, initialize Tracuto in your Application class, install recording, and grant consent before capture starts.
3. Allowlist package and signing cert
In Project settings, add your applicationId and release signing certificate SHA-256. Ingest rejects APKs that do not match.
4. Run the app once
Complete setup verifies automatically when the first Android event arrives. Confirm sessions appear under Analytics → Sessions.
Gradle dependencies
dependencies {
implementation("com.tracuto:tracuto-core:1.1.0")
implementation("com.tracuto:tracuto-analytics:1.1.0")
implementation("com.tracuto:tracuto-recording:1.1.0")
implementation("com.tracuto:tracuto-compose:1.1.0")
}Application init
class ExampleApp : Application() {
override fun onCreate() {
super.onCreate()
Tracuto.initialize(
this,
TracutoConfig(
projectId = "YOUR_PROJECT_ID",
publishableKey = "pk_live_…",
endpoint = "https://YOUR_INGEST_HOST",
recordingEnabled = true,
consentRequired = true,
),
)
TracutoRecording.install()
Tracuto.setRecordingConsent(granted = userHasAnalyticsConsent())
}
}Replace placeholders with values from Complete setup (Android path).
Jetpack Compose screens
@Composable
fun CheckoutScreen() {
Column(
modifier = Modifier.tracutoScreen(route = "/checkout", title = "Checkout"),
) {
PrimaryButton(
modifier = Modifier.tracutoTag("checkout_submit"),
onClick = { /* … */ },
)
}
}Track and convert
Tracuto.track("add_to_cart", mapOf("sku" to "SKU-4421"))
Tracuto.conversion("purchase_completed", 84.5, mapOf("currency" to "USD", "orderId" to "ord_123"))
Tracuto.setScreenName(screenId = "ProductDetail", route = "/product/4421", title = "Product")See Conversions and Identity for revenue and login patterns.
Signing allowlist
Add your app package name and signing certificate SHA-256 below. Mobile ingest rejects traffic that does not match the allowlist.
| Platform | Fields | Where |
|---|---|---|
| Android | packageName + signingCertSha256 | Project settings → Android native SDK, or Complete setup stage 2 |
Verify
- Use a publishable ingest key (pk_live_*) in the app — never embed secret keys.
- Confirm Complete setup shows verification after the first mobile session.
- Open Analytics → Sessions and filter by platform badge (Android or iOS).
- Native replay requires a native_snapshot event — ensure recording consent is granted.
SDK methods
| Method | Signature | When | Notes |
|---|---|---|---|
| Tracuto.initialize | initialize(context, TracutoConfig) | Application.onCreate | Required once; pass projectId, pk_live publishable key, and ingest endpoint from the dashboard |
| TracutoRecording.install | install() | After initialize | Captures TNVT view-tree snapshots and native taps for replay |
| Tracuto.setRecordingConsent | setRecordingConsent(granted) | Before recording | Required when consentRequired = true in config |
| Tracuto.track | track(name, properties?) | Custom product events | Screen views can use setScreenName or Compose tracutoScreen() |
| Tracuto.conversion | conversion(name, value?, properties?) | Funnel outcomes | Revenue in value; currency and order metadata in properties |
| Tracuto.identify | identify(userId?, traits) | After login | Stitches sessions to your account id and custom attributes |
AI assistant prompt
Integrate the Tracuto Android SDK in this codebase.
Documentation:
- Android guide: https://tracuto.com/integrate/android
- Conversions: https://tracuto.com/integrate/conversions
- Identity: https://tracuto.com/integrate/identity
Before writing code:
1. Ask me for projectId, ingest endpoint, and pk_live_* publishable key from Tracuto Complete setup (Android path).
2. Ask for applicationId and release signing cert SHA-256 for the allowlist.
3. Ask whether recording requires explicit consent before TracutoRecording.install().
Implementation rules:
- Add Gradle dependencies from the dashboard snippet only.
- Initialize in Application.onCreate; call TracutoRecording.install() after initialize.
- Gate recording with Tracuto.setRecordingConsent() when consentRequired is true.
- Use Tracuto.track / conversion for business events; screen routes via setScreenName or Compose tracutoScreen().
- Wire identify after login. Never embed sk_live_* keys.
When done, list files changed and how to verify in Complete setup.