Scala Tracker 1.0.0 released

We are pleased to announced version 1.0.0 of the Snowplow Scala Tracker.

This release includes many new features, which you can read about in detail on our docs website

Http4s emitter

Backed by a Http4s client, this emitter captures actions in the context of a functional effect type, such as a cats IO, ZIO or Monix Task. This is now our recommended emitter if you are familiar with functional programming and the cats ecosystem of type classes.

val resource = for {
  client   <- BlazeClientBuilder[IO](ExecutionContext.global).resource
  emitter <- Http4sEmitter.build[IO](EndpointParams("mycollector.com"), client)
} yield Tracker(emitter, "mytrackername", "myapplicationid")

resource.use { tracker =>
  // Use the tracker inside this block to initialize and run your application
  MyApp.run(tracker)
}

Configurable retry policies and event queue size policies

In combination, these policies give you finer control over how the tracker behaves when the collector is not available. You might use these policies to protect against excessive heap usage by choosing to drop unsent events under some circumstances.

Setting the subject

You can now either set the subject globally:

val tracker = Tracker(emitter, ns, appId).setSubject(subject)

or for each event individually:

t.trackPageView("www.example.com", subject = Some(subject))
1 Like