package data

import "cloud.google.com/go/analytics/data/apiv1alpha"

NOTE: This package is in alpha. It is not stable, and is likely to change.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.

Index

Examples

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type AlphaAnalyticsDataCallOptions

type AlphaAnalyticsDataCallOptions struct {
	RunReport            []gax.CallOption
	RunPivotReport       []gax.CallOption
	BatchRunReports      []gax.CallOption
	BatchRunPivotReports []gax.CallOption
	GetMetadata          []gax.CallOption
}

AlphaAnalyticsDataCallOptions contains the retry settings for each method of AlphaAnalyticsDataClient.

type AlphaAnalyticsDataClient

type AlphaAnalyticsDataClient struct {

	// The call options for this service.
	CallOptions *AlphaAnalyticsDataCallOptions
	// contains filtered or unexported fields
}

AlphaAnalyticsDataClient is a client for interacting with .

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewAlphaAnalyticsDataClient

func NewAlphaAnalyticsDataClient(ctx context.Context, opts ...option.ClientOption) (*AlphaAnalyticsDataClient, error)

NewAlphaAnalyticsDataClient creates a new alpha analytics data client.

Google Analytics reporting data service.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
)

func main() {
	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}

func (*AlphaAnalyticsDataClient) BatchRunPivotReports

BatchRunPivotReports returns multiple pivot reports in a batch. All reports must be for the same Entity.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.BatchRunPivotReportsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchRunPivotReports(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlphaAnalyticsDataClient) BatchRunReports

BatchRunReports returns multiple reports in a batch. All reports must be for the same Entity.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.BatchRunReportsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchRunReports(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlphaAnalyticsDataClient) Close

func (c *AlphaAnalyticsDataClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AlphaAnalyticsDataClient) Connection

func (c *AlphaAnalyticsDataClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AlphaAnalyticsDataClient) GetMetadata

GetMetadata returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. Dimensions and metrics will be mostly added over time, but renames and deletions may occur.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.GetMetadataRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetMetadata(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlphaAnalyticsDataClient) RunPivotReport

RunPivotReport returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.RunPivotReportRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.RunPivotReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlphaAnalyticsDataClient) RunReport

RunReport returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.

Example

Code:play 

package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.RunReportRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.RunReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Source Files

alpha_analytics_data_client.go doc.go

Version
v0.67.0
Published
Sep 29, 2020
Platform
windows/amd64
Imports
17 packages
Last checked
1 hour ago

Tools for package owners.