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
- Gradle
- Maven
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"
Add our Maven repository in your build.gradle
 file:
build.gradle
repositories {
...
jcenter()
}
Then add into the same file:
build.gradle
dependencies {
...
// Snowplow Scala Tracker
compile 'com.snowplowanalytics:snowplow-scala-tracker-core_2.13:2.0.0'
// If you plan to use the http4s emitters with an Ember client
compile 'com.snowplowanalytics:snowplow-scala-tracker-emitter-http4s_2.13:2.0.0'
compile 'org.http4s:http4s-ember-client_2.13:0.23.15'
// If you plan to use the id emitters
compile 'com.snowplowanalytics:snowplow-scala-tracker-emitter-id_2.13:2.0.0'
// If you plan to use EC2/GCE contexts:
compile 'com.snowplowanalytics:snowplow-scala-tracker-metadata_2.13:2.0.0'
}
Add into your project's pom.xml
:
pom.xml
<dependency>
<groupId>com.snowplowanalytics</groupId>
<artifactId>snowplow-scala-tracker-core_2.13</artifactId>
<version>2.0.0</version>
</dependency>
<!-- If you plan to use the http4s emitter with an Ember client: -->
<dependency>
<groupId>com.snowplowanalytics</groupId>
<artifactId>snowplow-scala-tracker-emitter-http4s_2.13</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-ember-client</artifactId>
<version>0.23.15</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>2.0.0</version>
</dependency>
<!-- If you plan to use EC2/GCE contexts: -->
<dependency>
<groupId>com.snowplowanalytics</groupId>
<artifactId>snowplow-scala-tracker-metadata_2.13</artifactId>
<version>2.0.0</version>
</dependency>
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).