package data
import "cloud.google.com/go/analytics/data/apiv1alpha"
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 ¶
- func DefaultAuthScopes() []string
- type AlphaAnalyticsDataCallOptions
- type AlphaAnalyticsDataClient
- func NewAlphaAnalyticsDataClient(ctx context.Context, opts ...option.ClientOption) (*AlphaAnalyticsDataClient, error)
- func (c *AlphaAnalyticsDataClient) BatchRunPivotReports(ctx context.Context, req *datapb.BatchRunPivotReportsRequest, opts ...gax.CallOption) (*datapb.BatchRunPivotReportsResponse, error)
- func (c *AlphaAnalyticsDataClient) BatchRunReports(ctx context.Context, req *datapb.BatchRunReportsRequest, opts ...gax.CallOption) (*datapb.BatchRunReportsResponse, error)
- func (c *AlphaAnalyticsDataClient) Close() error
- func (c *AlphaAnalyticsDataClient) Connection() *grpc.ClientConn
- func (c *AlphaAnalyticsDataClient) GetMetadata(ctx context.Context, req *datapb.GetMetadataRequest, opts ...gax.CallOption) (*datapb.Metadata, error)
- func (c *AlphaAnalyticsDataClient) RunPivotReport(ctx context.Context, req *datapb.RunPivotReportRequest, opts ...gax.CallOption) (*datapb.RunPivotReportResponse, error)
- func (c *AlphaAnalyticsDataClient) RunRealtimeReport(ctx context.Context, req *datapb.RunRealtimeReportRequest, opts ...gax.CallOption) (*datapb.RunRealtimeReportResponse, error)
- func (c *AlphaAnalyticsDataClient) RunReport(ctx context.Context, req *datapb.RunReportRequest, opts ...gax.CallOption) (*datapb.RunReportResponse, error)
Examples ¶
- AlphaAnalyticsDataClient.BatchRunPivotReports
- AlphaAnalyticsDataClient.BatchRunReports
- AlphaAnalyticsDataClient.GetMetadata
- AlphaAnalyticsDataClient.RunPivotReport
- AlphaAnalyticsDataClient.RunRealtimeReport
- AlphaAnalyticsDataClient.RunReport
- NewAlphaAnalyticsDataClient
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 RunRealtimeReport []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.
func (*AlphaAnalyticsDataClient) BatchRunPivotReports ¶
func (c *AlphaAnalyticsDataClient) BatchRunPivotReports(ctx context.Context, req *datapb.BatchRunPivotReportsRequest, opts ...gax.CallOption) (*datapb.BatchRunPivotReportsResponse, error)
BatchRunPivotReports returns multiple pivot reports in a batch. All reports must be for the same
Entity.
Code:play
Example¶
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 ¶
func (c *AlphaAnalyticsDataClient) BatchRunReports(ctx context.Context, req *datapb.BatchRunReportsRequest, opts ...gax.CallOption) (*datapb.BatchRunReportsResponse, error)
BatchRunReports returns multiple reports in a batch. All reports must be for the same
Entity.
Code:play
Example¶
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 ¶
func (c *AlphaAnalyticsDataClient) GetMetadata(ctx context.Context, req *datapb.GetMetadataRequest, opts ...gax.CallOption) (*datapb.Metadata, error)
GetMetadata returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked. Universal metadata are dimensions and
metrics applicable to any property such as country and totalUsers.
Code:play
Example¶
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 ¶
func (c *AlphaAnalyticsDataClient) RunPivotReport(ctx context.Context, req *datapb.RunPivotReportRequest, opts ...gax.CallOption) (*datapb.RunPivotReportResponse, error)
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.
Code:play
Example¶
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) RunRealtimeReport ¶
func (c *AlphaAnalyticsDataClient) RunRealtimeReport(ctx context.Context, req *datapb.RunRealtimeReportRequest, opts ...gax.CallOption) (*datapb.RunRealtimeReportResponse, error)
RunRealtimeReport the Google Analytics Realtime API returns a customized report of realtime
event data for your property. These reports show events and usage from the
last 30 minutes.
Code:play
Example¶
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.RunRealtimeReportRequest{
// TODO: Fill request struct fields.
}
resp, err := c.RunRealtimeReport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlphaAnalyticsDataClient) RunReport ¶
func (c *AlphaAnalyticsDataClient) RunReport(ctx context.Context, req *datapb.RunReportRequest, opts ...gax.CallOption) (*datapb.RunReportResponse, error)
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.
Code:play
Example¶
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.79.0
- Published
- Mar 10, 2021
- Platform
- linux/amd64
- Imports
- 18 packages
- Last checked
- 4 minutes ago –
Tools for package owners.