@@ -20,6 +20,7 @@ import "google/analytics/data/v1alpha/data.proto";
2020import "google/api/annotations.proto" ;
2121import "google/api/client.proto" ;
2222import "google/api/field_behavior.proto" ;
23+ import "google/api/resource.proto" ;
2324
2425option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data" ;
2526option java_multiple_files = true ;
@@ -88,6 +89,40 @@ service AlphaAnalyticsData {
8889 get : "/v1alpha/universalMetadata"
8990 };
9091 }
92+
93+ // Returns metadata for dimensions and metrics available in reporting methods.
94+ // Used to explore the dimensions and metrics. In this method, a Google
95+ // Analytics App + Web Property Identifier is specified in the request, and
96+ // the metadata response includes Custom dimensions and metrics as well as
97+ // Universal metadata.
98+ //
99+ // For example if a custom metric with parameter name `levels_unlocked` is
100+ // registered to a property, the Metadata response will contain
101+ // `customEvent:levels_unlocked`. Universal metadata are dimensions and
102+ // metrics applicable to any property such as `country` and `totalUsers`.
103+ rpc GetMetadata (GetMetadataRequest ) returns (Metadata ) {
104+ option (google.api.http ) = {
105+ get : "/v1alpha/{name=properties/*/metadata}"
106+ };
107+ option (google.api.method_signature ) = "name" ;
108+ }
109+ }
110+
111+ // The dimensions and metrics currently accepted in reporting methods.
112+ message Metadata {
113+ option (google.api.resource ) = {
114+ type : "analyticsdata.googleapis.com/Metadata"
115+ pattern : "properties/{property}/metadata"
116+ };
117+
118+ // Resource name of this metadata.
119+ string name = 3 ;
120+
121+ // The dimensions descriptions.
122+ repeated DimensionMetadata dimensions = 1 ;
123+
124+ // The metric descriptions.
125+ repeated MetricMetadata metrics = 2 ;
91126}
92127
93128// The request to generate a report.
@@ -353,3 +388,18 @@ message UniversalMetadata {
353388 // The metric descriptions.
354389 repeated MetricMetadata metrics = 2 ;
355390}
391+
392+ // Request for a property's dimension and metric metadata.
393+ message GetMetadataRequest {
394+ // Required. The resource name of the metadata to retrieve. This name field is
395+ // specified in the URL path and not URL parameters. Property is a numeric
396+ // Google Analytics App + Web Property identifier.
397+ //
398+ // Example: properties/1234/metadata
399+ string name = 1 [
400+ (google.api.field_behavior ) = REQUIRED ,
401+ (google.api.resource_reference ) = {
402+ type : "analyticsdata.googleapis.com/Metadata"
403+ }
404+ ];
405+ }
0 commit comments