Sep 20, 2024
Insights API client
The Insights API client is part of the algoliasearch-client-go
package.
To install it, run:
Copy
1
go get github.com/algolia/algoliasearch-client-go
To use the Insights client, add this import to your files:
Copy
1
import "github.com/algolia/algoliasearch-client-go/v4/algolia/insights"
To create an instance of the client:
Copy
1
2
3
4
5
client, err := insights.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", insights.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:
insights.US
for the United States or insights.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 Insights API.
Events
client.PushEvents | Send events |
User tokens
client.DeleteUserToken | Delete user token |
Did you find this page helpful?