Snowplow Golang Tracker 2.4.0 released

We’re pleased to announce a new update to the Snowplow Golang Tracker. The v2.4.0 release adds the ability to set the Subject per event, allowing the event level Subject to override the Subject that is set at the Tracker level.

This has been designed for long running Go applications that may have different requests that are for different users and you wish to customise the Subject information for each event.

e.g.

	trackerSubject := InitSubject()
	trackerSubject.SetUserId("123456789")

	tracker := InitTracker(
		RequireEmitter(InitEmitter(
			RequireCollectorUri("com.acme.collector"),
		)),
		OptionSubject(trackerSubject),
	)

	eventSubject := InitSubject()
	eventSubject.SetUserId("987654321")

	tracker.TrackPageView(PageViewEvent{
		PageUrl:  NewString("acme.com"),
		Contexts: contextArray,
		Subject:  eventSubject,
	})

	// Event Level 987654321 will be tracked as the UID (user_id)

	tracker.TrackPageView(PageViewEvent{
		PageUrl:  NewString("acme.com"),
		Contexts: contextArray,
	})

	//  Tracker Level 123456789 will be tracked as the UID (user_id)

Changelog

  • Add ability to set Subject per event (#50)
  • Update Copyright to 2020 (#51)
2 Likes