Skip to content

Commit

Permalink
feat: add UpdateConversionEvent method to the Admin API v1 beta
Browse files Browse the repository at this point in the history
feat: add the `counting_method` field to the `ConversionEvent` type
feat: add the `ConversionCountingMethod` enum
feat: add the `ITEM` option to the `DimensionScope` enum
feat: make the field `default_uri` of `WebStreamData` mutable
fix!: add the missing `REQUIRED` annotation to the `update_mask` field of `UpdateMeasurementProtocolSecretRequest`

PiperOrigin-RevId: 559470845
  • Loading branch information
Google APIs authored and Copybara-Service committed Aug 23, 2023
1 parent 3028d5c commit 751dfcf
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 9 deletions.
30 changes: 28 additions & 2 deletions google/analytics/admin/v1beta/analytics_admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,16 @@ service AnalyticsAdminService {
option (google.api.method_signature) = "parent,conversion_event";
}

// Updates a conversion event with the specified attributes.
rpc UpdateConversionEvent(UpdateConversionEventRequest)
returns (ConversionEvent) {
option (google.api.http) = {
patch: "/v1beta/{conversion_event.name=properties/*/conversionEvents/*}"
body: "conversion_event"
};
option (google.api.method_signature) = "conversion_event,update_mask";
}

// Retrieve a single conversion event.
rpc GetConversionEvent(GetConversionEventRequest) returns (ConversionEvent) {
option (google.api.http) = {
Expand Down Expand Up @@ -1126,8 +1136,10 @@ message UpdateMeasurementProtocolSecretRequest {
MeasurementProtocolSecret measurement_protocol_secret = 1
[(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated. Omitted fields will not be updated.
google.protobuf.FieldMask update_mask = 2;
// Required. The list of fields to be updated. Omitted fields will not be
// updated.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}

// Request message for ListMeasurementProtocolSecret RPC
Expand Down Expand Up @@ -1179,6 +1191,20 @@ message CreateConversionEventRequest {
];
}

// Request message for UpdateConversionEvent RPC
message UpdateConversionEventRequest {
// Required. The conversion event to update.
// The `name` field is used to identify the settings to be updated.
ConversionEvent conversion_event = 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 GetConversionEvent RPC
message GetConversionEventRequest {
// Required. The resource name of the conversion event to retrieve.
Expand Down
13 changes: 10 additions & 3 deletions google/analytics/admin/v1beta/analyticsadmin_v1beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ title: Google Analytics Admin API
apis:
- name: google.analytics.admin.v1beta.AnalyticsAdminService

documentation:
summary: |-
Manage properties in Google Analytics. Warning: Creating multiple Customer
Applications, Accounts, or Projects to simulate or act as a single
Customer Application, Account, or Project (respectively) or to circumvent
Service-specific usage limits or quotas is a direct violation of Google
Cloud Platform Terms of Service as well as Google APIs Terms of Service.
These actions can result in immediate termination of your GCP project(s)
without any warning.
authentication:
rules:
- selector: 'google.analytics.admin.v1beta.AnalyticsAdminService.*'
Expand Down Expand Up @@ -112,6 +122,3 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
publishing:
{}
35 changes: 31 additions & 4 deletions google/analytics/admin/v1beta/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,18 @@ message DataStream {

// Data specific to web streams.
message WebStreamData {
// Output only. Analytics "Measurement ID", without the "G-" prefix.
// Example: "G-1A2BCD345E" would just be "1A2BCD345E"
// Output only. Analytics Measurement ID.
//
// Example: "G-1A2BCD345E"
string measurement_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. ID of the corresponding web app in Firebase, if any.
// This ID can change if the web app is deleted and recreated.
string firebase_app_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Immutable. Domain name of the web app being measured, or empty.
// Domain name of the web app being measured, or empty.
// Example: "http://www.google.com", "https://www.google.com"
string default_uri = 3 [(google.api.field_behavior) = IMMUTABLE];
string default_uri = 3;
}

// Data specific to Android app streams.
Expand Down Expand Up @@ -680,6 +681,20 @@ message ConversionEvent {
pattern: "properties/{property}/conversionEvents/{conversion_event}"
};

// The method by which conversions will be counted across multiple events
// within a session.
enum ConversionCountingMethod {
// Counting method not specified.
CONVERSION_COUNTING_METHOD_UNSPECIFIED = 0;

// Each Event instance is considered a Conversion.
ONCE_PER_EVENT = 1;

// An Event instance is considered a Conversion at most once per session per
// user.
ONCE_PER_SESSION = 2;
}

// Output only. Resource name of this conversion event.
// Format: properties/{property}/conversionEvents/{conversion_event}
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand All @@ -703,6 +718,12 @@ message ConversionEvent {
// by property admins. Custom events count towards the maximum number of
// custom conversion events that may be created per property.
bool custom = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. The method by which conversions will be counted across multiple
// events within a session. If this value is not provided, it will be set to
// `ONCE_PER_EVENT`.
ConversionCountingMethod counting_method = 6
[(google.api.field_behavior) = OPTIONAL];
}

// A definition for a CustomDimension.
Expand All @@ -722,6 +743,9 @@ message CustomDimension {

// Dimension scoped to a user.
USER = 2;

// Dimension scoped to eCommerce items
ITEM = 3;
}

// Output only. Resource name for this CustomDimension resource.
Expand All @@ -734,6 +758,9 @@ message CustomDimension {
// If this is an event-scoped dimension, then this is the event parameter
// name.
//
// If this is an item-scoped dimension, then this is the parameter
// name found in the eCommerce items array.
//
// May only contain alphanumeric and underscore characters, starting with a
// letter. Max length of 24 characters for user-scoped dimensions, 40
// characters for event-scoped dimensions.
Expand Down

0 comments on commit 751dfcf

Please sign in to comment.