| Repository | convertmax-android |
| Package | io.convertmax.sdk |
| Version | 0.2.0 |
| minSdk | 23 |
| Install | Add the :convertmax module to your Gradle project |
Initialize
Create the client once, then grant consent before tracking:
val sdk = Convertmax.create(
this,
Configuration(
writeKey = "YOUR_WRITE_KEY",
appId = "com.example.app"
)
)
sdk.setConsent(Consent.GRANTED)
sdk.identify("account-123")
sdk.track("signup", mapOf("plan" to "pro"))
sdk.screen("Pricing")
Configuration also accepts:
| Option | Default |
|---|---|
environment |
production |
endpoint |
https://event.convertmax.io/v1/batch |
sessionTimeoutMs |
30 minutes |
Events
| Method | What it records |
|---|---|
identify(id) |
Sets the user ID and queues an identify event |
track(name, properties) |
Custom event. Property values are strings |
screen(name, properties) |
Screen view |
revenue(transactionReference, amount, currency) |
purchase_observed with the transaction reference |
handleDeepLink(uri) |
Reads utm_source, utm_medium, utm_campaign, utm_term, utm_content, and referrer |
reset() |
Clears the user ID and rotates the anonymous ID and session ID |
identify, track, and screen return null until consent is GRANTED.
Delivery
Events stay in SQLite until they are sent. The SDK flushes a gzip batch when the app backgrounds. Call flushToNetwork() to deliver the queue yourself. flush() only returns the queued events and clears them locally, so it does not send them.
diagnostics() reports how many events are queued and how many were dropped.