snowplow / snowplow-scala-tracker

Snowplow event tracker for Scala. Add analytics to your Scala, Akka and Play apps and servers
http://snowplowanalytics.com
8 stars 14 forks source link

Tracker method to set metadata after initialisation #149

Closed istreeter closed 3 years ago

istreeter commented 4 years ago

The tracker currently has a method for setting the Subject after initialisation. This is helpful, because Subject does not appear in the "short" Tracker constructor. It allows us to do this:

val t = Tracker(emitter, "namespace", "appId").setSubject(subject)

It would be helpful if we can use a similar pattern for setting the metadata/context:

val t = Tracker(emitter, "namespace", "appId").setMetadata(selfDescribingJson)