feat: add `runFunnelReport` method to the Alpha version of the Data API

PiperOrigin-RevId: 446813357
pull/717/head
Google APIs 3 years ago committed by Copybara-Service
parent 976b05ce14
commit 6d3ae1aca7
  1. 354
      google/analytics/data/v1alpha/BUILD.bazel
  2. 166
      google/analytics/data/v1alpha/analytics_data_api.proto
  3. 24
      google/analytics/data/v1alpha/analytics_data_grpc_service_config.json
  4. 23
      google/analytics/data/v1alpha/analyticsdata_v1alpha.yaml
  5. 1230
      google/analytics/data/v1alpha/data.proto

@ -0,0 +1,354 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "data_proto",
srcs = [
"analytics_data_api.proto",
"data.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"@com_google_protobuf//:duration_proto",
],
)
proto_library_with_info(
name = "data_proto_with_info",
deps = [
":data_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "data_java_proto",
deps = [":data_proto"],
)
java_grpc_library(
name = "data_java_grpc",
srcs = [":data_proto"],
deps = [":data_java_proto"],
)
java_gapic_library(
name = "data_java_gapic",
srcs = [":data_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "analytics_data_grpc_service_config.json",
service_yaml = "analyticsdata_v1alpha.yaml",
test_deps = [
":data_java_grpc",
],
deps = [
":data_java_proto",
"//google/api:api_java_proto",
],
)
java_gapic_test(
name = "data_java_gapic_test_suite",
test_classes = [
"com.google.analytics.data.v1alpha.AlphaAnalyticsDataClientTest",
],
runtime_deps = [":data_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-analytics-data-v1alpha-java",
deps = [
":data_java_gapic",
":data_java_grpc",
":data_java_proto",
":data_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "data_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/analytics/data/v1alpha",
protos = [":data_proto"],
deps = [
"//google/api:annotations_go_proto",
],
)
go_gapic_library(
name = "data_go_gapic",
srcs = [":data_proto_with_info"],
grpc_service_config = "analytics_data_grpc_service_config.json",
importpath = "google.golang.org/google/analytics/data/v1alpha;data",
service_yaml = "analyticsdata_v1alpha.yaml",
metadata = True,
deps = [
":data_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
],
)
go_test(
name = "data_go_gapic_test",
srcs = [":data_go_gapic_srcjar_test"],
embed = [":data_go_gapic"],
importpath = "google.golang.org/google/analytics/data/v1alpha",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-analytics-data-v1alpha-go",
deps = [
":data_go_gapic",
":data_go_gapic_srcjar-test.srcjar",
":data_go_gapic_srcjar-metadata.srcjar",
":data_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
)
py_gapic_library(
name = "data_py_gapic",
srcs = [":data_proto"],
grpc_service_config = "analytics_data_grpc_service_config.json",
service_yaml = "analyticsdata_v1alpha.yaml",
)
# Open Source Packages
py_gapic_assembly_pkg(
name = "analytics-data-v1alpha-py",
deps = [
":data_py_gapic",
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "data_php_proto",
deps = [":data_proto"],
)
php_grpc_library(
name = "data_php_grpc",
srcs = [":data_proto"],
deps = [":data_php_proto"],
)
php_gapic_library(
name = "data_php_gapic",
srcs = [":data_proto_with_info"],
grpc_service_config = "analytics_data_grpc_service_config.json",
service_yaml = "analyticsdata_v1alpha.yaml",
deps = [
":data_php_grpc",
":data_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-analytics-data-v1alpha-php",
deps = [
":data_php_gapic",
":data_php_grpc",
":data_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "data_nodejs_gapic",
package_name = "@google-cloud/data",
src = ":data_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "analytics_data_grpc_service_config.json",
package = "google.analytics.data.v1alpha",
service_yaml = "analyticsdata_v1alpha.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "analytics-data-v1alpha-nodejs",
deps = [
":data_nodejs_gapic",
":data_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_gapic_assembly_pkg",
"ruby_cloud_gapic_library",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "data_ruby_proto",
deps = [":data_proto"],
)
ruby_grpc_library(
name = "data_ruby_grpc",
srcs = [":data_proto"],
deps = [":data_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "data_ruby_gapic",
srcs = [":data_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-analytics-data-v1alpha",
],
grpc_service_config = "analytics_data_grpc_service_config.json",
deps = [
":data_ruby_grpc",
":data_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-analytics-data-v1alpha-ruby",
deps = [
":data_ruby_gapic",
":data_ruby_grpc",
":data_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "data_csharp_proto",
deps = [":data_proto"],
)
csharp_grpc_library(
name = "data_csharp_grpc",
srcs = [":data_proto"],
deps = [":data_csharp_proto"],
)
csharp_gapic_library(
name = "data_csharp_gapic",
srcs = [":data_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "analytics_data_grpc_service_config.json",
service_yaml = "analyticsdata_v1alpha.yaml",
deps = [
":data_csharp_grpc",
":data_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-analytics-data-v1alpha-csharp",
deps = [
":data_csharp_gapic",
":data_csharp_grpc",
":data_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)
cc_proto_library(
name = "data_cc_proto",
deps = [":data_proto"],
)
cc_grpc_library(
name = "data_cc_grpc",
srcs = [":data_proto"],
grpc_only = True,
deps = [":data_cc_proto"],
)

@ -0,0 +1,166 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.analytics.data.v1alpha;
import "google/analytics/data/v1alpha/data.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data";
option java_multiple_files = true;
option java_outer_classname = "AnalyticsDataApiProto";
option java_package = "com.google.analytics.data.v1alpha";
// Google Analytics reporting data service.
service AlphaAnalyticsData {
option (google.api.default_host) = "analyticsdata.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/analytics,"
"https://www.googleapis.com/auth/analytics.readonly";
// Returns a customized funnel report of your Google Analytics event data. The
// data returned from the API is as a table with columns for the requested
// dimensions and metrics.
//
// Funnel exploration lets you visualize the steps your users take to complete
// a task and quickly see how well they are succeeding or failing at each
// step. For example, how do prospects become shoppers and then become buyers?
// How do one time buyers become repeat buyers? With this information, you can
// improve inefficient or abandoned customer journeys. To learn more, see [GA4
// Funnel Explorations](https://support.google.com/analytics/answer/9327974).
rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) {
option (google.api.http) = {
post: "/v1alpha/{property=properties/*}:runFunnelReport"
body: "*"
};
}
}
// The request for a funnel report.
message RunFunnelReportRequest {
// Controls the dimensions present in the funnel visualization sub report
// response.
enum FunnelVisualizationType {
// Unspecified type.
FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0;
// A standard (stepped) funnel. The funnel visualization sub report in the
// response will not contain date.
STANDARD_FUNNEL = 1;
// A trended (line chart) funnel. The funnel visualization sub report in the
// response will contain the date dimension.
TRENDED_FUNNEL = 2;
}
// A Google Analytics GA4 property identifier whose events are tracked.
// Specified in the URL path and not the body. To learn more, see [where to
// find your Property
// ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
// Within a batch request, this property should either be unspecified or
// consistent with the batch-level property.
//
// Example: properties/1234
string property = 1;
// Date ranges of data to read. If multiple date ranges are requested, each
// response row will contain a zero based date range index. If two date
// ranges overlap, the event data for the overlapping days is included in the
// response rows for both date ranges.
repeated DateRange date_ranges = 2;
// The configuration of this request's funnel. This funnel configuration is
// required.
Funnel funnel = 3;
// If specified, this breakdown adds a dimension to the funnel table sub
// report response. This breakdown dimension expands each funnel step to the
// unique values of the breakdown dimension. For example, a breakdown by the
// `deviceCategory` dimension will create rows for `mobile`, `tablet`,
// `desktop`, and the total.
FunnelBreakdown funnel_breakdown = 4;
// If specified, next action adds a dimension to the funnel visualization sub
// report response. This next action dimension expands each funnel step to the
// unique values of the next action. For example a breakdown by the
// `eventName` dimension will create rows for several events (i.e.
// `session_start` & `click`) and the total.
FunnelNextAction funnel_next_action = 5;
// The funnel visualization type controls the dimensions present in the funnel
// visualization sub report response. If not specified, `STANDARD_FUNNEL` is
// used.
FunnelVisualizationType funnel_visualization_type = 6;
// The configurations of segments. Segments are subsets of a property's data.
// In a funnel report with segments, the funnel is evaluated in each segment.
//
// Each segment specified in this request
// produces a separate row in the response; in the response, each segment
// identified by its name.
//
// The segments parameter is optional. Requests are limited to 4 segments.
repeated Segment segments = 7;
// The number of rows to return. If unspecified, 10,000 rows are returned. The
// API returns a maximum of 100,000 rows per request, no matter how many you
// ask for. `limit` must be positive.
//
// The API can also return fewer rows than the requested `limit`, if there
// aren't as many dimension values as the `limit`.
int64 limit = 9;
// Dimension filters allow you to ask for only specific dimension values in
// the report. To learn more, see [Creating a Report: Dimension
// Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
// for examples. Metrics cannot be used in this filter.
FilterExpression dimension_filter = 10;
// Toggles whether to return the current state of this Analytics Property's
// quota. Quota is returned in [PropertyQuota](#PropertyQuota).
bool return_property_quota = 12;
}
// The funnel report response contains two sub reports. The two sub reports are
// different combinations of dimensions and metrics.
message RunFunnelReportResponse {
// The funnel table is a report with the funnel step, segment, breakdown
// dimension, active users, completion rate, abandonments, and abandonments
// rate.
//
// The segment dimension is only present in this response if a segment was
// requested. The breakdown dimension is only present in this response if it
// was requested.
FunnelSubReport funnel_table = 1;
// The funnel visualization is a report with the funnel step, segment, date,
// next action dimension, and active users.
//
// The segment dimension is only present in this response if a segment was
// requested. The date dimension is only present in this response if it was
// requested via the `TRENDED_FUNNEL` funnel type. The next action dimension
// is only present in the response if it was requested.
FunnelSubReport funnel_visualization = 2;
// This Analytics Property's quota state including this request.
PropertyQuota property_quota = 3;
// Identifies what kind of resource this message is. This `kind` is always the
// fixed string "analyticsData#runFunnelReport". Useful to distinguish between
// response types in JSON.
string kind = 4;
}

@ -0,0 +1,24 @@
{
"methodConfig": [
{
"name": [{ "service": "google.analytics.data.v1alpha.AlphaAnalyticsData" }],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "1s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNKNOWN"]
}
},
{
"name": [
{
"service": "google.analytics.data.v1alpha.AlphaAnalyticsData",
"method": "RunFunnelReport"
}
],
"timeout": "60s"
}
]
}

@ -0,0 +1,23 @@
type: google.api.Service
config_version: 3
name: analyticsdata.googleapis.com
title: Google Analytics Data API
apis:
- name: google.analytics.data.v1alpha.AlphaAnalyticsData
documentation:
summary: Accesses report data in Google Analytics.
backend:
rules:
- selector: google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport
deadline: 180.0
authentication:
rules:
- selector: google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics,
https://www.googleapis.com/auth/analytics.readonly

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save