audience_insights_service.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.ads.googleads.v11.services;
  16. import "google/ads/googleads/v11/common/criteria.proto";
  17. import "google/ads/googleads/v11/enums/audience_insights_dimension.proto";
  18. import "google/api/annotations.proto";
  19. import "google/api/client.proto";
  20. import "google/api/field_behavior.proto";
  21. option csharp_namespace = "Google.Ads.GoogleAds.V11.Services";
  22. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v11/services;services";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "AudienceInsightsServiceProto";
  25. option java_package = "com.google.ads.googleads.v11.services";
  26. option objc_class_prefix = "GAA";
  27. option php_namespace = "Google\\Ads\\GoogleAds\\V11\\Services";
  28. option ruby_package = "Google::Ads::GoogleAds::V11::Services";
  29. // Proto file describing the audience insights service.
  30. // Audience Insights Service helps users find information about groups of
  31. // people and how they can be reached with Google Ads.
  32. service AudienceInsightsService {
  33. option (google.api.default_host) = "googleads.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  35. // Creates a saved report that can be viewed in the Insights Finder tool.
  36. //
  37. // List of thrown errors:
  38. // [AuthenticationError]()
  39. // [AuthorizationError]()
  40. // [FieldError]()
  41. // [HeaderError]()
  42. // [InternalError]()
  43. // [QuotaError]()
  44. // [RangeError]()
  45. // [RequestError]()
  46. rpc GenerateInsightsFinderReport(GenerateInsightsFinderReportRequest) returns (GenerateInsightsFinderReportResponse) {
  47. option (google.api.http) = {
  48. post: "/v11/customers/{customer_id=*}:generateInsightsFinderReport"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "customer_id,baseline_audience,specific_audience";
  52. }
  53. // Searches for audience attributes that can be used to generate insights.
  54. //
  55. // List of thrown errors:
  56. // [AuthenticationError]()
  57. // [AuthorizationError]()
  58. // [FieldError]()
  59. // [HeaderError]()
  60. // [InternalError]()
  61. // [QuotaError]()
  62. // [RangeError]()
  63. // [RequestError]()
  64. rpc ListAudienceInsightsAttributes(ListAudienceInsightsAttributesRequest) returns (ListAudienceInsightsAttributesResponse) {
  65. option (google.api.http) = {
  66. post: "/v11/customers/{customer_id=*}:searchAudienceInsightsAttributes"
  67. body: "*"
  68. };
  69. option (google.api.method_signature) = "customer_id,dimensions,query_text";
  70. }
  71. // Returns a collection of attributes that are represented in an audience of
  72. // interest, with metrics that compare each attribute's share of the audience
  73. // with its share of a baseline audience.
  74. //
  75. // List of thrown errors:
  76. // [AudienceInsightsError]()
  77. // [AuthenticationError]()
  78. // [AuthorizationError]()
  79. // [FieldError]()
  80. // [HeaderError]()
  81. // [InternalError]()
  82. // [QuotaError]()
  83. // [RangeError]()
  84. // [RequestError]()
  85. rpc GenerateAudienceCompositionInsights(GenerateAudienceCompositionInsightsRequest) returns (GenerateAudienceCompositionInsightsResponse) {
  86. option (google.api.http) = {
  87. post: "/v11/customers/{customer_id=*}:generateAudienceCompositionInsights"
  88. body: "*"
  89. };
  90. option (google.api.method_signature) = "customer_id,audience,dimensions";
  91. }
  92. }
  93. // Request message for [AudienceInsightsService.GenerateInsightsFinderReport][google.ads.googleads.v11.services.AudienceInsightsService.GenerateInsightsFinderReport].
  94. message GenerateInsightsFinderReportRequest {
  95. // Required. The ID of the customer.
  96. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  97. // Required. A baseline audience for this report, typically all people in a region.
  98. BasicInsightsAudience baseline_audience = 2 [(google.api.field_behavior) = REQUIRED];
  99. // Required. The specific audience of interest for this report. The insights in the
  100. // report will be based on attributes more prevalent in this audience than
  101. // in the report's baseline audience.
  102. BasicInsightsAudience specific_audience = 3 [(google.api.field_behavior) = REQUIRED];
  103. // The name of the customer being planned for. This is a user-defined value.
  104. string customer_insights_group = 4;
  105. }
  106. // The response message for
  107. // [AudienceInsightsService.GenerateInsightsFinderReport][google.ads.googleads.v11.services.AudienceInsightsService.GenerateInsightsFinderReport], containing the
  108. // shareable URL for the report.
  109. message GenerateInsightsFinderReportResponse {
  110. // An HTTPS URL providing a deep link into the Insights Finder UI with the
  111. // report inputs filled in according to the request.
  112. string saved_report_url = 1;
  113. }
  114. // Request message for
  115. // [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights].
  116. message GenerateAudienceCompositionInsightsRequest {
  117. // Required. The ID of the customer.
  118. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  119. // Required. The audience of interest for which insights are being requested.
  120. InsightsAudience audience = 2 [(google.api.field_behavior) = REQUIRED];
  121. // The one-month range of historical data to use for insights, in the format
  122. // "yyyy-mm". If unset, insights will be returned for the last thirty days of
  123. // data.
  124. string data_month = 3;
  125. // Required. The audience dimensions for which composition insights should be returned.
  126. repeated google.ads.googleads.v11.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimensions = 4 [(google.api.field_behavior) = REQUIRED];
  127. // The name of the customer being planned for. This is a user-defined value.
  128. string customer_insights_group = 5;
  129. }
  130. // Response message for
  131. // [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights].
  132. message GenerateAudienceCompositionInsightsResponse {
  133. // The contents of the insights report, organized into sections.
  134. // Each section is associated with one of the AudienceInsightsDimension values
  135. // in the request. There may be more than one section per dimension.
  136. repeated AudienceCompositionSection sections = 1;
  137. }
  138. // Request message for
  139. // [AudienceInsightsService.ListAudienceInsightsAttributes][google.ads.googleads.v11.services.AudienceInsightsService.ListAudienceInsightsAttributes].
  140. message ListAudienceInsightsAttributesRequest {
  141. // Required. The ID of the customer.
  142. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  143. // Required. The types of attributes to be returned.
  144. repeated google.ads.googleads.v11.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimensions = 2 [(google.api.field_behavior) = REQUIRED];
  145. // Required. A free text query. Attributes matching or related to this string will be
  146. // returned.
  147. string query_text = 3 [(google.api.field_behavior) = REQUIRED];
  148. // The name of the customer being planned for. This is a user-defined value.
  149. string customer_insights_group = 4;
  150. }
  151. // Response message for
  152. // [AudienceInsightsService.ListAudienceInsightsAttributes][google.ads.googleads.v11.services.AudienceInsightsService.ListAudienceInsightsAttributes].
  153. message ListAudienceInsightsAttributesResponse {
  154. // The attributes matching the search query.
  155. repeated AudienceInsightsAttributeMetadata attributes = 1;
  156. }
  157. // An audience attribute that can be used to request insights about the
  158. // audience.
  159. message AudienceInsightsAttribute {
  160. // An audience attribute.
  161. oneof attribute {
  162. // An audience attribute defined by an age range.
  163. google.ads.googleads.v11.common.AgeRangeInfo age_range = 1;
  164. // An audience attribute defined by a gender.
  165. google.ads.googleads.v11.common.GenderInfo gender = 2;
  166. // An audience attribute defiend by a geographic location.
  167. google.ads.googleads.v11.common.LocationInfo location = 3;
  168. // An Affinity or In-Market audience.
  169. google.ads.googleads.v11.common.UserInterestInfo user_interest = 4;
  170. // An audience attribute defined by interest in a topic represented by a
  171. // Knowledge Graph entity.
  172. AudienceInsightsEntity entity = 5;
  173. // An audience attribute defined by interest in a Product & Service
  174. // category.
  175. AudienceInsightsCategory category = 6;
  176. // A YouTube Dynamic Lineup
  177. AudienceInsightsDynamicLineup dynamic_lineup = 7;
  178. // A Parental Status value (parent, or not a parent).
  179. google.ads.googleads.v11.common.ParentalStatusInfo parental_status = 8;
  180. // A household income percentile range.
  181. google.ads.googleads.v11.common.IncomeRangeInfo income_range = 9;
  182. // A YouTube channel.
  183. google.ads.googleads.v11.common.YouTubeChannelInfo youtube_channel = 10;
  184. }
  185. }
  186. // An entity or category representing a topic that defines an audience.
  187. message AudienceInsightsTopic {
  188. // An entity or category attribute.
  189. oneof topic {
  190. // A Knowledge Graph entity
  191. AudienceInsightsEntity entity = 1;
  192. // A Product & Service category
  193. AudienceInsightsCategory category = 2;
  194. }
  195. }
  196. // A Knowledge Graph entity, represented by its machine id.
  197. message AudienceInsightsEntity {
  198. // Required. The machine id (mid) of the Knowledge Graph entity.
  199. string knowledge_graph_machine_id = 1 [(google.api.field_behavior) = REQUIRED];
  200. }
  201. // A Product and Service category.
  202. message AudienceInsightsCategory {
  203. // Required. The criterion id of the category.
  204. string category_id = 1 [(google.api.field_behavior) = REQUIRED];
  205. }
  206. // A YouTube Dynamic Lineup.
  207. message AudienceInsightsDynamicLineup {
  208. // Required. The numeric ID of the dynamic lineup.
  209. string dynamic_lineup_id = 1 [(google.api.field_behavior) = REQUIRED];
  210. }
  211. // A description of an audience used for requesting insights.
  212. message BasicInsightsAudience {
  213. // Required. The countries for this audience.
  214. repeated google.ads.googleads.v11.common.LocationInfo country_location = 1 [(google.api.field_behavior) = REQUIRED];
  215. // Sub-country geographic location attributes. If present, each of these
  216. // must be contained in one of the countries in this audience.
  217. repeated google.ads.googleads.v11.common.LocationInfo sub_country_locations = 2;
  218. // Gender for the audience. If absent, the audience does not restrict by
  219. // gender.
  220. google.ads.googleads.v11.common.GenderInfo gender = 3;
  221. // Age ranges for the audience. If absent, the audience represents all people
  222. // over 18 that match the other attributes.
  223. repeated google.ads.googleads.v11.common.AgeRangeInfo age_ranges = 4;
  224. // User interests defining this audience. Affinity and In-Market audiences
  225. // are supported.
  226. repeated google.ads.googleads.v11.common.UserInterestInfo user_interests = 5;
  227. // Topics, represented by Knowledge Graph entities and/or Product & Service
  228. // categories, that this audience is interested in.
  229. repeated AudienceInsightsTopic topics = 6;
  230. }
  231. // An audience attribute, with metadata about it, returned in response to a
  232. // search.
  233. message AudienceInsightsAttributeMetadata {
  234. // The type of the attribute.
  235. google.ads.googleads.v11.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimension = 1;
  236. // The attribute itself.
  237. AudienceInsightsAttribute attribute = 2;
  238. // The human-readable name of the attribute.
  239. string display_name = 3;
  240. // A relevance score for this attribute, between 0 and 1.
  241. double score = 4;
  242. // A string that supplements the display_name to identify the attribute.
  243. // If the dimension is TOPIC, this is a brief description of the
  244. // Knowledge Graph entity, such as "American singer-songwriter".
  245. // If the dimension is CATEGORY, this is the complete path to the category in
  246. // The Product & Service taxonomy, for example
  247. // "/Apparel/Clothing/Outerwear".
  248. string display_info = 5;
  249. // Metadata specific to the dimension of this attribute.
  250. oneof dimension_metadata {
  251. // Special metadata for a YouTube channel.
  252. YouTubeChannelAttributeMetadata youtube_channel_metadata = 6;
  253. // Special metadata for a YouTube Dynamic Lineup.
  254. DynamicLineupAttributeMetadata dynamic_attribute_metadata = 7;
  255. }
  256. }
  257. // Metadata associated with a YouTube channel attribute.
  258. message YouTubeChannelAttributeMetadata {
  259. // The approximate number of subscribers to the YouTube channel.
  260. int64 subscriber_count = 1;
  261. }
  262. // Metadata associated with a Dynamic Lineup attribute.
  263. message DynamicLineupAttributeMetadata {
  264. // The national market associated with the lineup.
  265. google.ads.googleads.v11.common.LocationInfo inventory_country = 1;
  266. // The median number of impressions per month on this lineup.
  267. optional int64 median_monthly_inventory = 2;
  268. // The lower end of a range containing the number of channels in the lineup.
  269. optional int64 channel_count_lower_bound = 3;
  270. // The upper end of a range containing the number of channels in the lineup.
  271. optional int64 channel_count_upper_bound = 4;
  272. }
  273. // A set of users, defined by various characteristics, for which insights can
  274. // be requested in AudienceInsightsService.
  275. message InsightsAudience {
  276. // Required. The countries for the audience.
  277. repeated google.ads.googleads.v11.common.LocationInfo country_locations = 1 [(google.api.field_behavior) = REQUIRED];
  278. // Sub-country geographic location attributes. If present, each of these
  279. // must be contained in one of the countries in this audience. If absent, the
  280. // audience is geographically to the country_locations and no further.
  281. repeated google.ads.googleads.v11.common.LocationInfo sub_country_locations = 2;
  282. // Gender for the audience. If absent, the audience does not restrict by
  283. // gender.
  284. google.ads.googleads.v11.common.GenderInfo gender = 3;
  285. // Age ranges for the audience. If absent, the audience represents all people
  286. // over 18 that match the other attributes.
  287. repeated google.ads.googleads.v11.common.AgeRangeInfo age_ranges = 4;
  288. // Parental status for the audience. If absent, the audience does not
  289. // restrict by parental status.
  290. google.ads.googleads.v11.common.ParentalStatusInfo parental_status = 5;
  291. // Household income percentile ranges for the audience. If absent, the
  292. // audience does not restrict by household income range.
  293. repeated google.ads.googleads.v11.common.IncomeRangeInfo income_ranges = 6;
  294. // Dynamic lineups representing the YouTube content viewed by the audience.
  295. repeated AudienceInsightsDynamicLineup dynamic_lineups = 7;
  296. // A combination of entity, category and user interest attributes defining the
  297. // audience. The combination has a logical AND-of-ORs structure: Attributes
  298. // within each InsightsAudienceAttributeGroup are combined with OR, and
  299. // the combinations themselves are combined together with AND. For example,
  300. // the expression (Entity OR Affinity) AND (In-Market OR Category) can be
  301. // formed using two InsightsAudienceAttributeGroups with two Attributes
  302. // each.
  303. repeated InsightsAudienceAttributeGroup topic_audience_combinations = 8;
  304. }
  305. // A list of AudienceInsightsAttributes.
  306. message InsightsAudienceAttributeGroup {
  307. // Required. A collection of audience attributes to be combined with logical OR.
  308. // Attributes need not all be the same dimension. Only Knowledge Graph
  309. // entities, Product & Service Categories, and Affinity and In-Market
  310. // audiences are supported in this context.
  311. repeated AudienceInsightsAttribute attributes = 1 [(google.api.field_behavior) = REQUIRED];
  312. }
  313. // A collection of related attributes of the same type in an audience
  314. // composition insights report.
  315. message AudienceCompositionSection {
  316. // The type of the attributes in this section.
  317. google.ads.googleads.v11.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimension = 1;
  318. // The most relevant segments for this audience. If dimension is GENDER,
  319. // AGE_RANGE or PARENTAL_STATUS, then this list of attributes is exhaustive.
  320. repeated AudienceCompositionAttribute top_attributes = 3;
  321. // Additional attributes for this audience, grouped into clusters. Only
  322. // populated if dimension is YOUTUBE_CHANNEL.
  323. repeated AudienceCompositionAttributeCluster clustered_attributes = 4;
  324. }
  325. // A collection of related attributes, with metadata and metrics, in an audience
  326. // composition insights report.
  327. message AudienceCompositionAttributeCluster {
  328. // The name of this cluster of attributes
  329. string cluster_display_name = 1;
  330. // If the dimension associated with this cluster is YOUTUBE_CHANNEL, then
  331. // cluster_metrics are metrics associated with the cluster as a whole.
  332. // For other dimensions, this field is unset.
  333. AudienceCompositionMetrics cluster_metrics = 3;
  334. // The individual attributes that make up this cluster, with metadata and
  335. // metrics.
  336. repeated AudienceCompositionAttribute attributes = 4;
  337. }
  338. // The share and index metrics associated with an attribute in an audience
  339. // composition insights report.
  340. message AudienceCompositionMetrics {
  341. // The fraction (from 0 to 1 inclusive) of the baseline audience that match
  342. // the attribute.
  343. double baseline_audience_share = 1;
  344. // The fraction (from 0 to 1 inclusive) of the specific audience that match
  345. // the attribute.
  346. double audience_share = 2;
  347. // The ratio of audience_share to baseline_audience_share, or zero if this
  348. // ratio is undefined or is not meaningful.
  349. double index = 3;
  350. // A relevance score from 0 to 1 inclusive.
  351. double score = 4;
  352. }
  353. // An audience attribute with metadata and metrics.
  354. message AudienceCompositionAttribute {
  355. // The attribute with its metadata.
  356. AudienceInsightsAttributeMetadata attribute_metadata = 1;
  357. // Share and index metrics for the attribute.
  358. AudienceCompositionMetrics metrics = 2;
  359. }