This client is new in v4 of the Go API clients.

The Analytics API client is part of the algoliasearch-client-go package. To install it, run:

1
go get github.com/algolia/algoliasearch-client-go

To use the Analytics client, add this import to your files:

1
import "github.com/algolia/algoliasearch-client-go/v4/algolia/analytics"

To create an instance of the client:

1
2
3
4
5
client, err := analytics.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", analytics.US)
if err != nil {
  // The client can fail to initialize if you pass an invalid parameter.
  panic(err)
}

Make sure to use the region that matches your Algolia application’s analytics region: analytics.US for the United States or analytics.DE for Europe. You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.

List of methods

Each method makes one request to the Analytics API.

Searches

Clicks

Users

Filters

Status

Did you find this page helpful?