feat: add `GetAdSenseLink`, `CreateAdSenseLink`, `DeleteAdSenseLink`, `ListAdSenseLinks` methods to the Admin API v1alpha

feat: add `FetchConnectedGa4Property` method to the Admin API v1alpha
feat: add `CreateEventCreateRule`, `UpdateEventCreateRule`,`DeleteEventCreateRule`, `ListEventCreateRules` methods to the Admin API v1alpha
feat: add `EventCreateRule`, `MatchingCondition` types to the Admin API v1alpha
feat: add `AdSenseLink` type to the Admin API v1alpha
feat: add `AUDIENCE`, `EVENT_CREATE_RULE` options to the `ChangeHistoryResourceType` enum
feat: add `audience`, `event_create_rule` fields to the `ChangeHistoryResource.resource` oneof field

PiperOrigin-RevId: 531601348
pull/804/head
Google APIs 2 years ago committed by Copybara-Service
parent 2407c56d50
commit ef2e2ea532
  1. 6
      google/analytics/admin/v1alpha/BUILD.bazel
  2. 248
      google/analytics/admin/v1alpha/analytics_admin.proto
  3. 10
      google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml
  4. 25
      google/analytics/admin/v1alpha/audience.proto
  5. 162
      google/analytics/admin/v1alpha/event_create_and_edit.proto
  6. 37
      google/analytics/admin/v1alpha/resources.proto

@ -25,6 +25,7 @@ proto_library(
"analytics_admin.proto",
"audience.proto",
"channel_group.proto",
"event_create_and_edit.proto",
"expanded_data_set.proto",
"resources.proto",
],
@ -136,7 +137,7 @@ go_gapic_library(
name = "admin_go_gapic",
srcs = [":admin_proto_with_info"],
grpc_service_config = "admin_grpc_service_config.json",
importpath = "cloud.google.com/go/analytics/admin/apiv1alpha;admin",
importpath = "google.golang.org/google/analytics/admin/v1alpha;adminpb",
metadata = True,
release_level = "alpha",
rest_numeric_enums = True,
@ -152,7 +153,7 @@ go_test(
name = "admin_go_gapic_test",
srcs = [":admin_go_gapic_srcjar_test"],
embed = [":admin_go_gapic"],
importpath = "cloud.google.com/go/analytics/admin/apiv1alpha",
importpath = "google.golang.org/google/analytics/admin/v1alpha",
)
# Open Source Packages
@ -232,6 +233,7 @@ php_gapic_library(
name = "admin_php_gapic",
srcs = [":admin_proto_with_info"],
grpc_service_config = "admin_grpc_service_config.json",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
rest_numeric_enums = True,
service_yaml = "analyticsadmin_v1alpha.yaml",
transport = "grpc+rest",

@ -19,6 +19,7 @@ package google.analytics.admin.v1alpha;
import "google/analytics/admin/v1alpha/access_report.proto";
import "google/analytics/admin/v1alpha/audience.proto";
import "google/analytics/admin/v1alpha/channel_group.proto";
import "google/analytics/admin/v1alpha/event_create_and_edit.proto";
import "google/analytics/admin/v1alpha/expanded_data_set.proto";
import "google/analytics/admin/v1alpha/resources.proto";
import "google/api/annotations.proto";
@ -1238,6 +1239,87 @@ service AnalyticsAdminService {
get: "/v1alpha/properties:fetchConnectedGa4Property"
};
}
// Looks up a single AdSenseLink.
rpc GetAdSenseLink(GetAdSenseLinkRequest) returns (AdSenseLink) {
option (google.api.http) = {
get: "/v1alpha/{name=properties/*/adSenseLinks/*}"
};
option (google.api.method_signature) = "name";
}
// Creates an AdSenseLink.
rpc CreateAdSenseLink(CreateAdSenseLinkRequest) returns (AdSenseLink) {
option (google.api.http) = {
post: "/v1alpha/{parent=properties/*}/adSenseLinks"
body: "adsense_link"
};
option (google.api.method_signature) = "parent,adsense_link";
}
// Deletes an AdSenseLink.
rpc DeleteAdSenseLink(DeleteAdSenseLinkRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=properties/*/adSenseLinks/*}"
};
option (google.api.method_signature) = "name";
}
// Lists AdSenseLinks on a property.
rpc ListAdSenseLinks(ListAdSenseLinksRequest)
returns (ListAdSenseLinksResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=properties/*}/adSenseLinks"
};
option (google.api.method_signature) = "parent";
}
// Lookup for a single EventCreateRule.
rpc GetEventCreateRule(GetEventCreateRuleRequest) returns (EventCreateRule) {
option (google.api.http) = {
get: "/v1alpha/{name=properties/*/dataStreams/*/eventCreateRules/*}"
};
option (google.api.method_signature) = "name";
}
// Lists EventCreateRules on a web data stream.
rpc ListEventCreateRules(ListEventCreateRulesRequest)
returns (ListEventCreateRulesResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=properties/*/dataStreams/*}/eventCreateRules"
};
option (google.api.method_signature) = "parent";
}
// Creates an EventCreateRule.
rpc CreateEventCreateRule(CreateEventCreateRuleRequest)
returns (EventCreateRule) {
option (google.api.http) = {
post: "/v1alpha/{parent=properties/*/dataStreams/*}/eventCreateRules"
body: "event_create_rule"
};
option (google.api.method_signature) = "parent,event_create_rule";
}
// Updates an EventCreateRule.
rpc UpdateEventCreateRule(UpdateEventCreateRuleRequest)
returns (EventCreateRule) {
option (google.api.http) = {
patch: "/v1alpha/{event_create_rule.name=properties/*/dataStreams/*/eventCreateRules/*}"
body: "event_create_rule"
};
option (google.api.method_signature) = "event_create_rule,update_mask";
}
// Deletes an EventCreateRule.
rpc DeleteEventCreateRule(DeleteEventCreateRuleRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=properties/*/dataStreams/*/eventCreateRules/*}"
};
option (google.api.method_signature) = "name";
}
}
// The request for a Data Access Record Report.
@ -3406,6 +3488,83 @@ message ListConnectedSiteTagsResponse {
repeated ConnectedSiteTag connected_site_tags = 1;
}
// Request message to be passed to CreateAdSenseLink method.
message CreateAdSenseLinkRequest {
// Required. The property for which to create an AdSense Link.
// Format: properties/{propertyId}
// Example: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
// Required. The AdSense Link to create
AdSenseLink adsense_link = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message to be passed to GetAdSenseLink method.
message GetAdSenseLinkRequest {
// Required. Unique identifier for the AdSense Link requested.
// Format: properties/{propertyId}/adSenseLinks/{linkId}
// Example: properties/1234/adSenseLinks/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
}
// Request message to be passed to DeleteAdSenseLink method.
message DeleteAdSenseLinkRequest {
// Required. Unique identifier for the AdSense Link to be deleted.
// Format: properties/{propertyId}/adSenseLinks/{linkId}
// Example: properties/1234/adSenseLinks/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
}
// Request message to be passed to ListAdSenseLinks method.
message ListAdSenseLinksRequest {
// Required. Resource name of the parent property.
// Format: properties/{propertyId}
// Example: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
// The maximum number of resources to return.
// If unspecified, at most 50 resources will be returned.
// The maximum value is 200 (higher values will be coerced to the maximum).
int32 page_size = 2;
// A page token received from a previous `ListAdSenseLinks` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListAdSenseLinks` must
// match the call that provided the page token.
string page_token = 3;
}
// Response message for ListAdSenseLinks method.
message ListAdSenseLinksResponse {
// List of AdSenseLinks.
repeated AdSenseLink adsense_links = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request for looking up GA4 property connected to a UA property.
message FetchConnectedGa4PropertyRequest {
// Required. The UA property for which to look up the connected GA4 property.
@ -3431,3 +3590,92 @@ message FetchConnectedGa4PropertyResponse {
type: "analyticsadmin.googleapis.com/Property"
}];
}
// Request message for CreateEventCreateRule RPC.
message CreateEventCreateRuleRequest {
// Required. Example format: properties/123/dataStreams/456
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
// Required. The EventCreateRule to create.
EventCreateRule event_create_rule = 2
[(google.api.field_behavior) = REQUIRED];
}
// Request message for UpdateEventCreateRule RPC.
message UpdateEventCreateRuleRequest {
// Required. The EventCreateRule to update.
// The resource's `name` field is used to identify the EventCreateRule to be
// updated.
EventCreateRule event_create_rule = 1
[(google.api.field_behavior) = REQUIRED];
// Required. The list of fields to be updated. Field names must be in snake
// case (e.g., "field_to_update"). Omitted fields will not be updated. To
// replace the entire entity, use one path with the string "*" to match all
// fields.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}
// Request message for DeleteEventCreateRule RPC.
message DeleteEventCreateRuleRequest {
// Required. Example format:
// properties/123/dataStreams/456/eventCreateRules/789
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
}
// Request message for GetEventCreateRule RPC.
message GetEventCreateRuleRequest {
// Required. The name of the EventCreateRule to get.
// Example format: properties/123/dataStreams/456/eventCreateRules/789
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
}
// Request message for ListEventCreateRules RPC.
message ListEventCreateRulesRequest {
// Required. Example format: properties/123/dataStreams/456
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
// The maximum number of resources to return.
// If unspecified, at most 50 resources will be returned.
// The maximum value is 200 (higher values will be coerced to the maximum).
int32 page_size = 2;
// A page token, received from a previous `ListEventCreateRules` call. Provide
// this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListEventCreateRules`
// must match the call that provided the page token.
string page_token = 3;
}
// Response message for ListEventCreateRules RPC.
message ListEventCreateRulesResponse {
// List of EventCreateRules. These will be ordered stably, but in an arbitrary
// order.
repeated EventCreateRule event_create_rules = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}

@ -152,6 +152,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetEventCreateRule
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet
oauth:
canonical_scopes: |-
@ -252,6 +257,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListEventCreateRules
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets
oauth:
canonical_scopes: |-

@ -153,7 +153,12 @@ message AudienceDimensionOrMetricFilter {
BetweenFilter between_filter = 5;
}
// Required. Immutable. The dimension name or metric name to filter.
// Required. Immutable. The dimension name or metric name to filter. If the
// field name refers to a custom dimension or metric, a scope prefix will be
// added to the front of the custom dimensions or metric name. For more on
// scope prefixes or custom dimensions/metrics, reference the [Google
// Analytics Data API documentation]
// (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#custom_dimensions).
string field_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
@ -170,7 +175,7 @@ message AudienceDimensionOrMetricFilter {
// Optional. If set, specifies the time window for which to evaluate data in
// number of days. If not set, then audience data is evaluated against
// lifetime data (i.e., infinite time window).
// lifetime data (For example, infinite time window).
//
// For example, if set to 1 day, only the current day's data is evaluated. The
// reference point is the current day when at_any_point_in_time is unset or
@ -193,7 +198,7 @@ message AudienceEventFilter {
// Optional. If specified, this filter matches events that match both the
// single event name and the parameter filter expressions. AudienceEventFilter
// inside the parameter filter expression cannot be set (i.e., nested
// inside the parameter filter expression cannot be set (For example, nested
// event filters are not supported). This should be a single and_group of
// dimension_or_metric_filter or not_expression; ANDs of ORs are not
// supported. Also, if it includes a filter for "eventCount", only that one
@ -215,9 +220,9 @@ message AudienceFilterExpression {
// AudienceFilterExpressions with and_group or or_group.
AudienceFilterExpressionList or_group = 2;
// A filter expression to be NOT'ed (i.e., inverted, complemented). It
// can only include a dimension_or_metric_filter. This cannot be set on the
// top level AudienceFilterExpression.
// A filter expression to be NOT'ed (For example, inverted, complemented).
// It can only include a dimension_or_metric_filter. This cannot be set on
// the top level AudienceFilterExpression.
AudienceFilterExpression not_expression = 3;
// A filter on a single dimension or metric. This cannot be set on the top
@ -273,7 +278,7 @@ message AudienceSequenceFilter {
bool immediately_follows = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. When set, this step must be satisfied within the
// constraint_duration of the previous step (i.e., t[i] - t[i-1] <=
// constraint_duration of the previous step (For example, t[i] - t[i-1] <=
// constraint_duration). If not set, there is no duration requirement (the
// duration is effectively unlimited). It is ignored for the first step.
google.protobuf.Duration constraint_duration = 3
@ -304,9 +309,9 @@ message AudienceSequenceFilter {
}
// A clause for defining either a simple or sequence filter. A filter can be
// inclusive (i.e., users satisfying the filter clause are included in the
// Audience) or exclusive (i.e., users satisfying the filter clause are
// excluded from the Audience).
// inclusive (For example, users satisfying the filter clause are included in
// the Audience) or exclusive (For example, users satisfying the filter clause
// are excluded from the Audience).
message AudienceFilterClause {
// Specifies whether this is an include or exclude filter clause.
enum AudienceClauseType {

@ -0,0 +1,162 @@
// Copyright 2023 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.admin.v1alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
option go_package = "cloud.google.com/go/analytics/admin/apiv1alpha/adminpb;adminpb";
option java_multiple_files = true;
option java_package = "com.google.analytics.admin.v1alpha";
// Defines an event parameter to mutate.
message ParameterMutation {
// Required. The name of the parameter to mutate.
// This value must:
// * be less than 40 characters.
// * be unique across across all mutations within the rule
// * consist only of letters, digits or _ (underscores)
// For event edit rules, the name may also be set to 'event_name' to modify
// the event_name in place.
string parameter = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The value mutation to perform.
// * Must be less than 100 characters.
// * To specify a constant value for the param, use the value's string.
// * To copy value from another parameter, use syntax like
// "[[other_parameter]]" For more details, see this [help center
// article](https://support.google.com/analytics/answer/10085872#modify-an-event&zippy=%2Cin-this-article%2Cmodify-parameters).
string parameter_value = 2 [(google.api.field_behavior) = REQUIRED];
}
// An Event Create Rule defines conditions that will trigger the creation
// of an entirely new event based upon matched criteria of a source event.
// Additional mutations of the parameters from the source event can be defined.
//
// Unlike Event Edit rules, Event Creation Rules have no defined order. They
// will all be run independently.
//
// Event Edit and Event Create rules can't be used to modify an event created
// from an Event Create rule.
message EventCreateRule {
option (google.api.resource) = {
type: "analyticsadmin.googleapis.com/EventCreateRule"
pattern: "properties/{property}/dataStreams/{data_stream}/eventCreateRules/{event_create_rule}"
};
// Output only. Resource name for this EventCreateRule resource.
// Format:
// properties/{property}/dataStreams/{data_stream}/eventCreateRules/{event_create_rule}
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. The name of the new event to be created.
//
// This value must:
// * be less than 40 characters
// * consist only of letters, digits or _ (underscores)
// * start with a letter
string destination_event = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Must have at least one condition, and can have up to 10 max.
// Conditions on the source event must match for this rule to be applied.
repeated MatchingCondition event_conditions = 3
[(google.api.field_behavior) = REQUIRED];
// If true, the source parameters are copied to the new event.
// If false, or unset, all non-internal parameters are not copied from the
// source event. Parameter mutations are applied after the parameters have
// been copied.
bool source_copy_parameters = 4;
// Parameter mutations define parameter behavior on the new event, and
// are applied in order.
// A maximum of 20 mutations can be applied.
repeated ParameterMutation parameter_mutations = 5;
}
// Defines a condition for when an Event Edit or Event Creation rule applies to
// an event.
message MatchingCondition {
// Comparison type for matching condition
enum ComparisonType {
// Unknown
COMPARISON_TYPE_UNSPECIFIED = 0;
// Equals, case sensitive
EQUALS = 1;
// Equals, case insensitive
EQUALS_CASE_INSENSITIVE = 2;
// Contains, case sensitive
CONTAINS = 3;
// Contains, case insensitive
CONTAINS_CASE_INSENSITIVE = 4;
// Starts with, case sensitive
STARTS_WITH = 5;
// Starts with, case insensitive
STARTS_WITH_CASE_INSENSITIVE = 6;
// Ends with, case sensitive
ENDS_WITH = 7;
// Ends with, case insensitive
ENDS_WITH_CASE_INSENSITIVE = 8;
// Greater than
GREATER_THAN = 9;
// Greater than or equal
GREATER_THAN_OR_EQUAL = 10;
// Less than
LESS_THAN = 11;
// Less than or equal
LESS_THAN_OR_EQUAL = 12;
// regular expression. Only supported for web streams.
REGULAR_EXPRESSION = 13;
// regular expression, case insensitive. Only supported for web streams.
REGULAR_EXPRESSION_CASE_INSENSITIVE = 14;
}
// Required. The name of the field that is compared against for the condition.
// If 'event_name' is specified this condition will apply to the name of the
// event. Otherwise the condition will apply to a parameter with the
// specified name.
//
// This value cannot contain spaces.
string field = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The type of comparison to be applied to the value.
ComparisonType comparison_type = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The value being compared against for this condition. The runtime
// implementation may perform type coercion of this value to evaluate this
// condition based on the type of the parameter value.
string value = 3 [(google.api.field_behavior) = REQUIRED];
// Whether or not the result of the comparison should be negated. For example,
// if `negated` is true, then 'equals' comparisons would function as 'not
// equals'.
bool negated = 4;
}

@ -16,7 +16,9 @@ syntax = "proto3";
package google.analytics.admin.v1alpha;
import "google/analytics/admin/v1alpha/audience.proto";
import "google/analytics/admin/v1alpha/channel_group.proto";
import "google/analytics/admin/v1alpha/event_create_and_edit.proto";
import "google/analytics/admin/v1alpha/expanded_data_set.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
@ -213,6 +215,15 @@ enum ChangeHistoryResourceType {
// EnhancedMeasurementSettings resource
ENHANCED_MEASUREMENT_SETTINGS = 24;
// AdSenseLink resource
ADSENSE_LINK = 27;
// Audience resource
AUDIENCE = 28;
// EventCreateRule resource
EVENT_CREATE_RULE = 29;
}
// Status of the Google Signals settings.
@ -857,6 +868,15 @@ message ChangeHistoryChange {
// A snapshot of EnhancedMeasurementSettings resource in change history.
EnhancedMeasurementSettings enhanced_measurement_settings = 24;
// A snapshot of an AdSenseLink resource in change history.
AdSenseLink adsense_link = 27;
// A snapshot of an Audience resource in change history.
Audience audience = 28;
// A snapshot of an EventCreateRule resource in change history.
EventCreateRule event_create_rule = 29;
}
}
@ -1563,3 +1583,20 @@ message ConnectedSiteTag {
// or the "G-ID" (For example: G-12345).
string tag_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// A link between a GA4 Property and an AdSense for Content ad client.
message AdSenseLink {
option (google.api.resource) = {
type: "analyticsadmin.googleapis.com/AdSenseLink"
pattern: "properties/{property}/adSenseLinks/{adsense_link}"
};
// Output only. The resource name for this AdSense Link resource.
// Format: properties/{propertyId}/adSenseLinks/{linkId}
// Example: properties/1234/adSenseLinks/6789
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Immutable. The AdSense ad client code that the GA4 property is linked to.
// Example format: "ca-pub-1234567890"
string ad_client_code = 2 [(google.api.field_behavior) = IMMUTABLE];
}

Loading…
Cancel
Save