Collecting data with Trackers and Webhooks

  1. Home
  2. Docs
  3. Collecting data with Trackers and Webhooks
  4. Trackers – collecting data from your own applications
  5. Java Tracker
  6. Setup

Setup

Integration options

Tracker compatibility

The Snowplow Java Tracker has been built and tested using Java versions 8, 11 and 13, so should work within any Java application built using JDK8 upwards.

Dependencies

To minimize jar bloat, we have tried to keep external dependencies to a minimum. For the full list of dependencies, please see our Gradle build file.

Setup

Installation

The current version of the Snowplow Java Tracker is 0.10.1

You can also manually insert the Tracker by downloading the jar directly: snowplow-java-tracker-0.10.1.jar

Maven

Add into your project’s pom.xml:

<dependency> <groupId>com.snowplowanalytics</groupId> <artifactId>snowplow-java-tracker</artifactId> <version>0.10.1</version> </dependency>
Code language: HTML, XML (xml)

Gradle

Add into your project’s build.gradle:

dependencies { // Snowplow Java Tracker implementation 'com.snowplowanalytics:snowplow-java-tracker:0.10.1' }
Code language: JavaScript (javascript)

From 0.10.1 you can also specify the feature variants via Gradle, to pull in the required optional dependencies.

Adding OkHttp Support

dependencies { implementation 'com.snowplowanalytics:snowplow-java-tracker:0.10.1' implementation ('com.snowplowanalytics:snowplow-java-tracker:0.10.1') { capabilities { requireCapability 'com.snowplowanalytics:snowplow-java-tracker-okhttp-support:0.10.1' } } }
Code language: JavaScript (javascript)

Adding ApacheHttp Support

dependencies { implementation 'com.snowplowanalytics:snowplow-java-tracker:0.10.1' implementation ('com.snowplowanalytics:snowplow-java-tracker:0.10.1') { capabilities { requireCapability 'com.snowplowanalytics:snowplow-java-tracker-apachehttp-support:0.10.1' } } }
Code language: JavaScript (javascript)

SBT

The Snowplow Java Tracker is also usable from Scala. Add this to your SBT config:

// Dependency val snowplowTracker = "com.snowplowanalytics" % "snowplow-java-tracker" % "0.10.1"
Code language: JavaScript (javascript)

If you’d like to learn more about Snowplow Insights you can book a demo with our team, or if you’d prefer, you can try Snowplow technology for yourself quickly and easily.