Scala tracker setup - ClaraVista-IT/snowplow GitHub Wiki
HOME > SNOWPLOW SETUP GUIDE > Step 2: setup a Tracker > Scala tracker
## 1. OverviewThe Snowplow Scala Tracker lets you add analytics to your Scala apps and servers.
Setting up the tracker should be relatively straightforward if you are familiar with sbt.
## 2. Setup ### 2.1 HostingThe Tracker is published to Snowplow's [hosted Maven repository] maven-snplow, which should make it easy to add it as a dependency into your own Scala app.
### 2.2 SBTAdd the Scala Tracker to your build.sbt like this:
// Resolvers
val snowplowRepo = "Snowplow Releases" at "http://maven.snplow.com/releases/"
// Libraries
libraryDependencies += "com.snowplowanalytics.snowplow" %% "snowplow-scala-tracker" % "0.2.0"
If you are using Gradle in your own Scala application, then add our Maven repository in your build.gradle
file:
repositories {
...
maven {
url "http://maven.snplow.com/releases"
}
}
Then add into the same file:
dependencies {
...
// Snowplow Scala Tracker
compile 'com.snowplowanalytics:snowplow-scala-tracker:0.2.0'
}
If you are using Maven for building your Scala application, then add the following code into your HOME/.m2/settings.xml
to be able to use this repository:
<settings>
<profiles>
<profile>
<!-- ... -->
<repositories>
<repository>
<id>com.snowplowanalytics</id>
<name>SnowPlow Analytics</name>
<url>http://maven.snplow.com/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Then add into your project's pom.xml
:
<dependency>
<groupId>com.snowplowanalytics</groupId>
<artifactId>snowplow-scala-tracker</artifactId>
<version>0.2.0</version>
</dependency>
Done? Now read the Scala Tracker API to start tracking events.