GuidesBackend

Java analytics SDK, cookieless and EU-hosted event tracking

Server-side event tracking for JVM backends, cookieless and hosted in Germany.

Privytics collects product analytics from Java backends using the OpenPanel Java SDK, a community-maintained library targeting Java 11+. It is a plain JVM library with no framework coupling, so it drops into any Java application. You add one dependency, build a client with your client ID and secret, and point apiUrl at https://api.privytics.com. Tracking calls are asynchronous and return CompletableFuture, so they do not block your request threads.

Why Java teams use Privytics

Server-side events are never blocked

Events sent from your JVM process go straight from your server to the Privytics ingestion API. There is no browser script for adblockers, tracking protection or extensions to interfere with, so backend event counts do not silently under-report.

Track what actually happened, not what the client guessed

Your backend is the source of truth for payments captured, jobs completed, webhooks processed and orders shipped. Calling track() at the point the transaction commits records the real outcome rather than a click that may never have succeeded.

Nothing is written to a user device

Privytics is cookieless by default and the Java SDK runs entirely on your server, so there is no device storage and no client-side identifier to disclose. If you want cross-session profiles you pass your own user id to identify(), which is opt-in and needs your own lawful basis.

Async calls with retries, built for request threads

Every tracking method returns CompletableFuture<Void>, so you can fire and forget or chain error handling. Failed 5xx and network requests retry automatically with exponential backoff (3 retries starting at 500ms by default), and 4xx errors are not retried.

Set it up

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

  1. Add the dependency

    The package is published to Maven Central as fr.idcapture:openpanel-java. For Gradle use implementation 'fr.idcapture:openpanel-java:0.4.0' (Groovy) or implementation("fr.idcapture:openpanel-java:0.4.0") (Kotlin DSL).

    <dependency>
        <groupId>fr.idcapture</groupId>
        <artifactId>openpanel-java</artifactId>
        <version>0.4.0</version>
    </dependency>
  2. Initialise the client

    Set apiUrl to https://api.privytics.com. The SDK hardcodes OpenPanel's own host as the default, so this line is required. The client secret is needed for server-side events.

    import fr.idcapture.openpanel.OpenPanel;
    import fr.idcapture.openpanel.OpenPanelOptions;
    
    OpenPanel op = OpenPanel.create(
        OpenPanelOptions.builder()
            .clientId("YOUR_CLIENT_ID")
            .clientSecret("YOUR_CLIENT_SECRET")
            .apiUrl("https://api.privytics.com")
            .build()
    );
  3. Track an event

    Pass an event name on its own, or add properties and the user id the event belongs to.

    // Minimal
    op.track("page_viewed");
    
    // With properties
    op.track("button_clicked", Map.of("button_id", "submit_form"));
    
    // With the user it belongs to
    op.track("checkout_started", Map.of("cart_value", 149.99), "user123");
  4. Set global properties and shut down cleanly

    Global properties are merged into every track() call, which is a good fit for backend metadata like release version and environment. OpenPanel implements AutoCloseable, so close it explicitly or use try-with-resources when your application stops.

    op.setGlobalProperties(Map.of(
        "app_version", "2.1.0",
        "env", "production"
    ));
    
    // Subsequent calls include app_version and env automatically
    op.track("feature_used", Map.of("feature", "export"));
    
    // Shut down the client when your application stops
    op.close();

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

Questions

Is the OpenPanel Java SDK official?

No. The docs describe it as a community-maintained SDK by idcapture, and the published POM lists a single third-party developer at idcapture.fr rather than the OpenPanel team. Privytics is likewise independent and not affiliated with or endorsed by OpenPanel.

Does Java analytics tracking need a cookie banner?

The SDK runs on your server and Privytics is cookieless by default, so nothing is stored on the visitor's device by this integration. You remain the data controller and are responsible for deciding what consent your own processing requires.

Do I need the client secret?

Yes for server-side events. The docs list clientSecret as required for server-side tracking, so keep it in your server configuration or secret manager and never ship it to a client application.

Will tracking slow down my request handling?

Every tracking method returns CompletableFuture<Void>, so you can ignore the future and let the call complete in the background. Connection and read timeouts default to 10 and 30 seconds and are configurable on the options builder.

Where is the event data stored?

Event data is stored in EU data centres in Germany. The Java SDK sends it to https://api.privytics.com, which you set via apiUrl when building the client.