api: google.golang.org/api/analytics/v2.4 Index | Files

package analytics

import "google.golang.org/api/analytics/v2.4"

Package analytics provides access to the Google Analytics API.

For product documentation, see: https://developers.google.com/analytics/

Creating a client

Usage example:

import "google.golang.org/api/analytics/v2.4"
...
ctx := context.Background()
analyticsService, err := analytics.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication.

For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:

analyticsService, err := analytics.NewService(ctx, option.WithScopes(analytics.AnalyticsReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:

analyticsService, err := analytics.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
analyticsService, err := analytics.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Package Files

analytics-gen.go

Constants

const (
    // View and manage your Google Analytics data
    AnalyticsScope = "https://www.googleapis.com/auth/analytics"

    // View your Google Analytics data
    AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
)

OAuth2 scopes used by this API.

type DataGetCall Uses

type DataGetCall struct {
    // contains filtered or unexported fields
}

func (*DataGetCall) Context Uses

func (c *DataGetCall) Context(ctx context.Context) *DataGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*DataGetCall) Dimensions Uses

func (c *DataGetCall) Dimensions(dimensions string) *DataGetCall

Dimensions sets the optional parameter "dimensions": A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.

func (*DataGetCall) Do Uses

func (c *DataGetCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.data.get" call.

func (*DataGetCall) Fields Uses

func (c *DataGetCall) Fields(s ...googleapi.Field) *DataGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*DataGetCall) Filters Uses

func (c *DataGetCall) Filters(filters string) *DataGetCall

Filters sets the optional parameter "filters": A comma-separated list of dimension or metric filters to be applied to the report data.

func (*DataGetCall) Header Uses

func (c *DataGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*DataGetCall) IfNoneMatch Uses

func (c *DataGetCall) IfNoneMatch(entityTag string) *DataGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*DataGetCall) MaxResults Uses

func (c *DataGetCall) MaxResults(maxResults int64) *DataGetCall

MaxResults sets the optional parameter "max-results": The maximum number of entries to include in this feed.

func (*DataGetCall) Segment Uses

func (c *DataGetCall) Segment(segment string) *DataGetCall

Segment sets the optional parameter "segment": An Analytics advanced segment to be applied to the report data.

func (*DataGetCall) Sort Uses

func (c *DataGetCall) Sort(sort string) *DataGetCall

Sort sets the optional parameter "sort": A comma-separated list of dimensions or metrics that determine the sort order for the report data.

func (*DataGetCall) StartIndex Uses

func (c *DataGetCall) StartIndex(startIndex int64) *DataGetCall

StartIndex sets the optional parameter "start-index": An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type DataService Uses

type DataService struct {
    // contains filtered or unexported fields
}

func NewDataService Uses

func NewDataService(s *Service) *DataService

func (*DataService) Get Uses

func (r *DataService) Get(ids string, startDate string, endDate string, metrics string) *DataGetCall

Get: Returns Analytics report data for a view (profile).

type ManagementAccountsListCall Uses

type ManagementAccountsListCall struct {
    // contains filtered or unexported fields
}

func (*ManagementAccountsListCall) Context Uses

func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ManagementAccountsListCall) Do Uses

func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.management.accounts.list" call.

func (*ManagementAccountsListCall) Fields Uses

func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ManagementAccountsListCall) Header Uses

func (c *ManagementAccountsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ManagementAccountsListCall) IfNoneMatch Uses

func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ManagementAccountsListCall) MaxResults Uses

func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall

MaxResults sets the optional parameter "max-results": The maximum number of accounts to include in this response.

func (*ManagementAccountsListCall) StartIndex Uses

func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall

StartIndex sets the optional parameter "start-index": An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type ManagementAccountsService Uses

type ManagementAccountsService struct {
    // contains filtered or unexported fields
}

func NewManagementAccountsService Uses

func NewManagementAccountsService(s *Service) *ManagementAccountsService

func (*ManagementAccountsService) List Uses

func (r *ManagementAccountsService) List() *ManagementAccountsListCall

List: Lists all accounts to which the user has access.

type ManagementGoalsListCall Uses

type ManagementGoalsListCall struct {
    // contains filtered or unexported fields
}

func (*ManagementGoalsListCall) Context Uses

func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ManagementGoalsListCall) Do Uses

func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.management.goals.list" call.

func (*ManagementGoalsListCall) Fields Uses

func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ManagementGoalsListCall) Header Uses

func (c *ManagementGoalsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ManagementGoalsListCall) IfNoneMatch Uses

func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ManagementGoalsListCall) MaxResults Uses

func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall

MaxResults sets the optional parameter "max-results": The maximum number of goals to include in this response.

func (*ManagementGoalsListCall) StartIndex Uses

func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall

StartIndex sets the optional parameter "start-index": An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type ManagementGoalsService Uses

type ManagementGoalsService struct {
    // contains filtered or unexported fields
}

func NewManagementGoalsService Uses

func NewManagementGoalsService(s *Service) *ManagementGoalsService

func (*ManagementGoalsService) List Uses

func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall

List: Lists goals to which the user has access.

type ManagementProfilesListCall Uses

type ManagementProfilesListCall struct {
    // contains filtered or unexported fields
}

func (*ManagementProfilesListCall) Context Uses

func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ManagementProfilesListCall) Do Uses

func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.management.profiles.list" call.

func (*ManagementProfilesListCall) Fields Uses

func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ManagementProfilesListCall) Header Uses

func (c *ManagementProfilesListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ManagementProfilesListCall) IfNoneMatch Uses

func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ManagementProfilesListCall) MaxResults Uses

func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall

MaxResults sets the optional parameter "max-results": The maximum number of views (profiles) to include in this response.

func (*ManagementProfilesListCall) StartIndex Uses

func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall

StartIndex sets the optional parameter "start-index": An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type ManagementProfilesService Uses

type ManagementProfilesService struct {
    // contains filtered or unexported fields
}

func NewManagementProfilesService Uses

func NewManagementProfilesService(s *Service) *ManagementProfilesService

func (*ManagementProfilesService) List Uses

func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall

List: Lists views (profiles) to which the user has access.

type ManagementSegmentsListCall Uses

type ManagementSegmentsListCall struct {
    // contains filtered or unexported fields
}

func (*ManagementSegmentsListCall) Context Uses

func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ManagementSegmentsListCall) Do Uses

func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.management.segments.list" call.

func (*ManagementSegmentsListCall) Fields Uses

func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ManagementSegmentsListCall) Header Uses

func (c *ManagementSegmentsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ManagementSegmentsListCall) IfNoneMatch Uses

func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ManagementSegmentsListCall) MaxResults Uses

func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall

MaxResults sets the optional parameter "max-results": The maximum number of advanced segments to include in this response.

func (*ManagementSegmentsListCall) StartIndex Uses

func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall

StartIndex sets the optional parameter "start-index": An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type ManagementSegmentsService Uses

type ManagementSegmentsService struct {
    // contains filtered or unexported fields
}

func NewManagementSegmentsService Uses

func NewManagementSegmentsService(s *Service) *ManagementSegmentsService

func (*ManagementSegmentsService) List Uses

func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall

List: Lists advanced segments to which the user has access.

type ManagementService Uses

type ManagementService struct {
    Accounts *ManagementAccountsService

    Goals *ManagementGoalsService

    Profiles *ManagementProfilesService

    Segments *ManagementSegmentsService

    Webproperties *ManagementWebpropertiesService
    // contains filtered or unexported fields
}

func NewManagementService Uses

func NewManagementService(s *Service) *ManagementService

type ManagementWebpropertiesListCall Uses

type ManagementWebpropertiesListCall struct {
    // contains filtered or unexported fields
}

func (*ManagementWebpropertiesListCall) Context Uses

func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ManagementWebpropertiesListCall) Do Uses

func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) error

Do executes the "analytics.management.webproperties.list" call.

func (*ManagementWebpropertiesListCall) Fields Uses

func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ManagementWebpropertiesListCall) Header Uses

func (c *ManagementWebpropertiesListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ManagementWebpropertiesListCall) IfNoneMatch Uses

func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ManagementWebpropertiesListCall) MaxResults Uses

func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall

MaxResults sets the optional parameter "max-results": The maximum number of web properties to include in this response.

func (*ManagementWebpropertiesListCall) StartIndex Uses

func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall

StartIndex sets the optional parameter "start-index": An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

type ManagementWebpropertiesService Uses

type ManagementWebpropertiesService struct {
    // contains filtered or unexported fields
}

func NewManagementWebpropertiesService Uses

func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService

func (*ManagementWebpropertiesService) List Uses

func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall

List: Lists web properties to which the user has access.

type Service Uses

type Service struct {
    BasePath  string // API endpoint base URL
    UserAgent string // optional additional User-Agent fragment

    Data *DataService

    Management *ManagementService
    // contains filtered or unexported fields
}

func New Uses

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService Uses

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

Package analytics imports 14 packages (graph). Updated 2019-09-17. Refresh now. Tools for package owners.