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. Scala Tracker
  6. Scala Tracker (1.0.0)
  7. Setup

Setup

The Tracker is published to Maven Central and JCenter, which should make it easy to add it as a dependency into your own Scala app.

SBT

Add the Scala Tracker to your build.sbt like this:

libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-core" % "1.0.0" // If you plan to use the http4s emitter with a blaze client libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-emitter-https" % "1.0.0" libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.21.5" // If you plan to use the id emitters: libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-emitter-id" % "1.0.0"
Code language: JavaScript (javascript)

Gradle

If you are using Gradle in your own Scala application, then add our Maven repository in your build.gradle file:

repositories { ... jcenter() }

Then add into the same file:

dependencies { ... // Snowplow Scala Tracker compile 'com.snowplowanalytics:snowplow-scala-tracker-core_2.13:1.0.0' // If you plan to use the http4s emitters with a blaze client compile 'com.snowplowanalytics:snowplow-scala-tracker-emitter-http4s_2.13:1.0.0' compile 'org.http4s:http4s-blaze.client_2.13:0.21.5' // If you plan to use the id emitters compile 'com.snowplowanalytics:snowplow-scala-tracker-emitter-id_2.13:1.0.0' }
Code language: JavaScript (javascript)

Notice a _2.13 postfix in artifactId. This is used for Scala libraries and denote Scala version which artifact (in our case snowplow-scala-tracker) is compiled against. It also means that this library will bring a org.scala-lang:scala-library_2.13.x as transitive dependency and if you’re using any other Scala dependency you should keep these postfixes in accordance (snowplow-scala-tracker is also compiled against Scala 2.12).

Maven

If you are using Maven for building your Scala application, then add into your project’s pom.xml:

<dependency> <groupId>com.snowplowanalytics</groupId> <artifactId>snowplow-scala-tracker-core_2.13</artifactId> <version>1.0.0</version> </dependency> <!-- If you plan to use the http4s emitter with a blaze client: --> <dependency> <groupId>com.snowplowanalytics</groupId> <artifactId>snowplow-scala-tracker-emitter-http4s_2.13</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.http4s</groupId> <artifactId>http4s-blaze-client</artifactId> <version>0.21.5</version> </dependency> <!-- If you plan to use the id emitters: --> <dependency> <groupId>com.snowplowanalytics</groupId> <artifactId>snowplow-scala-tracker-emitter-id_2.13</artifactId> <version>1.0.0</version> </dependency>
Code language: HTML, XML (xml)

Notice a _2.13 postfix in artifactId. This is used for Scala libraries and denote Scala version which artifact (in our case snowplow-scala-tracker) is compiled against. It also means that this library will bring a org.scala-lang:scala-library_2.13.x as transitive dependency and if you’re using any other Scala dependency you should keep these postfixes in accordance (snowplow-scala-tracker is also compiled against Scala 2.12).

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.