GuidesMobile

Android Kotlin analytics, cookieless and hosted in Germany

Track Android events with the OpenPanel Kotlin SDK, pointed at EU-hosted Privytics.

Privytics is managed product analytics for Android apps, built on the open-source OpenPanel engine, with event data stored in Germany. You add the OpenPanel Kotlin SDK, point apiUrl at Privytics, and call track from anywhere in your app. Initialisation is a single call and the SDK is documented as thread-safe, so you can call it from any thread without wrapping it yourself.

Why Kotlin (Android) teams use Privytics

Nothing is written to the device

Privytics is cookieless by default and does not need an advertising ID. The anonymous visitor id is computed server side and resets every day. That keeps your Play Console Data safety declaration short, though you remain responsible for filling it in.

App lifecycle events without extra code

Set automaticTracking = true and the SDK emits app_opened and app_closed for you. That gives you sessions and retention on day one, before you have instrumented a single custom event.

Device context is attached automatically

Every event carries os and os_version, manufacturer, brand and model, screen_width, screen_height and screen_dpi, app_version and app_build_number, and network details such as wifi and carrier. You do not build a device properties map yourself.

No third-party script in the path

Events go from your app straight to https://api.privytics.com over HTTPS. There is no injected web script and no third-party analytics domain, so mobile ad blockers and DNS filters are not part of the path.

Set it up

About five minutes, on the free plan, without a credit card.

  1. Add the dependency

    The SDK is OpenPanel's own package, distributed under the dev.openpanel group id. Privytics is independent and not affiliated with OpenPanel. Note that upstream still marks this artifact as not yet published, so you will need to build it from the kotlin-sdk repository until it lands on Maven Central.

    dependencies {
        implementation 'dev.openpanel:openpanel:0.0.1'
    }
  2. Initialise with your Privytics API URL

    apiUrl is the option for pointing the SDK at a non-default instance, and it is required for Privytics. If you omit it your events go to OpenPanel's own host instead. clientSecret is documented as being needed only for server-side events, so leave it out of the app binary.

    import dev.openpanel.OpenPanel
    
    val op = OpenPanel.create(
        context,
        OpenPanel.Options(
            clientId = "YOUR_CLIENT_ID",
            apiUrl = "https://api.privytics.com"
        )
    )
  3. Track events and identify users

    track takes an event name and a property map. identify attaches your own user id so sessions link into one profile. That is opt-in and needs your own lawful basis.

    op.track("button_clicked", mapOf("button_id" to "submit_form"))
    
    op.identify("user123", mapOf(
        "firstName" to "John",
        "lastName" to "Doe",
        "email" to "john@example.com"
    ))
    
    // Call on sign out to remove the current user
    op.clear()
  4. Turn on automatic lifecycle tracking

    With automaticTracking enabled the SDK records app_opened and app_closed. setGlobalProperties adds fields to every event that follows, which is useful for build channel or environment.

    val op = OpenPanel.create(
        context,
        OpenPanel.Options(
            clientId = "YOUR_CLIENT_ID",
            apiUrl = "https://api.privytics.com",
            automaticTracking = true
        )
    )
    
    op.setGlobalProperties(mapOf(
        "app_version" to "1.0.2",
        "environment" to "production"
    ))

Privytics runs the open-source OpenPanel engine, so the upstream Kotlin (Android) SDK reference applies here too. Point apiUrl at Privytics and the data lands in your Privytics project.

Questions

Is the OpenPanel Kotlin SDK on Maven Central?

Not at the time of writing. The upstream README states the package is not yet published and that you cannot install it with gradle, and a Maven Central search for the dev.openpanel group returns no artifacts. Until it is published you build it from the Openpanel-dev/kotlin-sdk repository.

Does Android analytics need cookies or the advertising ID?

Not with Privytics. It is cookieless by default and the anonymous visitor id is derived server side from a daily-rotating salted hash of IP, user agent and project id. Nothing is written to the device for identification, and the SDK does not collect an advertising ID.

Does the Kotlin SDK track screen views automatically?

No. The documented automatic tracking covers app_opened and app_closed only. For screen views you call op.track yourself with your own event name and properties.

How do I follow the same user across sessions and reinstalls?

Call op.identify with your own user id, for example your account id after sign in. That links sessions into one profile. It is opt-in, so make sure you have a lawful basis before you send it.

Where is the event data stored?

In EU data centres in Germany. Privytics is a managed service built on the open-source OpenPanel engine, which is AGPL-3.0, but Privytics is independent and not affiliated with or endorsed by OpenPanel.