All URIs are relative to https://api.gitbook.com/v1
Method | HTTP request | Description |
---|---|---|
GetContentAnalyticsForSpaceById | Get /spaces/{spaceId}/insights/content | Get content analytics for a given space. |
GetSearchAnalyticsForSpaceById | Get /spaces/{spaceId}/insights/search | Get an overview of the top search queries in a space. |
GetTrafficAnalyticsForSpaceById | Get /spaces/{spaceId}/insights/traffic | Get traffic page views for a given space |
TrackViewInSpaceById | Post /spaces/{spaceId}/insights/track_view |
AnalyticsContentPages GetContentAnalyticsForSpaceById(ctx, spaceId).Execute()
Get content analytics for a given space.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
spaceId := "spaceId_example" // string | The unique id of the space
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnalyticsApi.GetContentAnalyticsForSpaceById(context.Background(), spaceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnalyticsApi.GetContentAnalyticsForSpaceById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetContentAnalyticsForSpaceById`: AnalyticsContentPages
fmt.Fprintf(os.Stdout, "Response from `AnalyticsApi.GetContentAnalyticsForSpaceById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | The unique id of the space |
Other parameters are passed through a pointer to a apiGetContentAnalyticsForSpaceByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AnalyticsTopSearches GetSearchAnalyticsForSpaceById(ctx, spaceId).Period(period).Execute()
Get an overview of the top search queries in a space.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
spaceId := "spaceId_example" // string | The unique id of the space
period := openapiclient.AnalyticsSearchPeriod("last_month") // AnalyticsSearchPeriod | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnalyticsApi.GetSearchAnalyticsForSpaceById(context.Background(), spaceId).Period(period).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnalyticsApi.GetSearchAnalyticsForSpaceById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetSearchAnalyticsForSpaceById`: AnalyticsTopSearches
fmt.Fprintf(os.Stdout, "Response from `AnalyticsApi.GetSearchAnalyticsForSpaceById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | The unique id of the space |
Other parameters are passed through a pointer to a apiGetSearchAnalyticsForSpaceByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
period | AnalyticsSearchPeriod | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AnalyticsTrafficPageViews GetTrafficAnalyticsForSpaceById(ctx, spaceId).Interval(interval).Execute()
Get traffic page views for a given space
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
spaceId := "spaceId_example" // string | The unique id of the space
interval := openapiclient.AnalyticsTrafficInterval("daily") // AnalyticsTrafficInterval | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnalyticsApi.GetTrafficAnalyticsForSpaceById(context.Background(), spaceId).Interval(interval).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnalyticsApi.GetTrafficAnalyticsForSpaceById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTrafficAnalyticsForSpaceById`: AnalyticsTrafficPageViews
fmt.Fprintf(os.Stdout, "Response from `AnalyticsApi.GetTrafficAnalyticsForSpaceById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | The unique id of the space |
Other parameters are passed through a pointer to a apiGetTrafficAnalyticsForSpaceByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
interval | AnalyticsTrafficInterval | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TrackViewInSpaceById(ctx, spaceId).RequestSpaceTrackPageView(requestSpaceTrackPageView).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
spaceId := "spaceId_example" // string | The unique id of the space
requestSpaceTrackPageView := *openapiclient.NewRequestSpaceTrackPageView("PageId_example", *openapiclient.NewRequestSpaceTrackPageViewVisitor("AnonymousId_example", map[string]string{"key": "Inner_example"}, "UserAgent_example"), "Url_example", "Referrer_example") // RequestSpaceTrackPageView |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.AnalyticsApi.TrackViewInSpaceById(context.Background(), spaceId).RequestSpaceTrackPageView(requestSpaceTrackPageView).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnalyticsApi.TrackViewInSpaceById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | The unique id of the space |
Other parameters are passed through a pointer to a apiTrackViewInSpaceByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
requestSpaceTrackPageView | RequestSpaceTrackPageView | |
(empty response body)
integration, integration-installation, user-internal, user, user-staff
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]