Skip to main content

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.

Add the Scala Tracker to your build.sbt:

build.sbt
libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-core" % "2.0.0"

// If you plan to use the http4s emitter with an Ember client
libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-emitter-http4s" % "2.0.0"
libraryDependencies += "org.http4s" %% "http4s-ember-client" % "0.23.15"

// If you plan to use the id emitters:
libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-emitter-id" % "2.0.0"

// If you plan to use EC2/GCE contexts:
libraryDependencies += "com.snowplowanalytics" %% "snowplow-scala-tracker-metadata" % "2.0.0"
For Maven and Gradle users

Notice a _2.13 postfix in artifactId. This is used for Scala libraries and denotes the Scala version which the 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).

Was this page helpful?