Skip to main content
The Go SDK makes it easy to track events from Go applications.

Installation

The Go SDK can be installed from GitHub:
To initialize the Go SDK in your application, create a new Client instance:

API

Identify

The htevents.Identify message sends an identify event. Unlike the Browser SDK, it does not persist the user ID and traits locally, so user IDs must be explicitly added to other events. This is because server side events are usually servicing many different users at once. Example usage:
Method parameters:

Track

The htevents.Track message sends a track event. Example usage:
Method parameters:

Page

The htevents.Page message sends a page event. Example usage:
Method parameters:

Screen

The htevents.Screen message sends a screen event. Example usage:
Method parameters:

Group

The htevents.Group message sends a group event. Example usage:
Method parameters:

Close

The Go SDK buffers events locally before sending them to Hightouch’s servers. This minimizes the number of requests made by the SDK and makes the tracking non-blocking. To force the local buffer to be sent to Hightouch immediately call the Close method. Close should be called when shutting down your app to make sure no events are lost. Example usage:
Last modified on March 12, 2024