audience_insights_service.proto 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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.v12.services;
  16. import "google/ads/googleads/v12/common/criteria.proto";
  17. import "google/ads/googleads/v12/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.V12.Services";
  22. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "AudienceInsightsServiceProto";
  25. option java_package = "com.google.ads.googleads.v12.services";
  26. option objc_class_prefix = "GAA";
  27. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  28. option ruby_package = "Google::Ads::GoogleAds::V12::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: "/v12/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: "/v12/customers/{customer_id=*}:searchAudienceInsightsAttributes"
  67. body: "*"
  68. };
  69. option (google.api.method_signature) = "customer_id,dimensions,query_text";
  70. }
  71. // Lists date ranges for which audience insights data can be requested.
  72. //
  73. // List of thrown errors:
  74. // [AuthenticationError]()
  75. // [AuthorizationError]()
  76. // [FieldError]()
  77. // [HeaderError]()
  78. // [InternalError]()
  79. // [QuotaError]()
  80. // [RangeError]()
  81. // [RequestError]()
  82. rpc ListInsightsEligibleDates(ListInsightsEligibleDatesRequest) returns (ListInsightsEligibleDatesResponse) {
  83. option (google.api.http) = {
  84. post: "/v12/audienceInsights:listInsightsEligibleDates"
  85. body: "*"
  86. };
  87. }
  88. // Returns a collection of attributes that are represented in an audience of
  89. // interest, with metrics that compare each attribute's share of the audience
  90. // with its share of a baseline audience.
  91. //
  92. // List of thrown errors:
  93. // [AudienceInsightsError]()
  94. // [AuthenticationError]()
  95. // [AuthorizationError]()
  96. // [FieldError]()
  97. // [HeaderError]()
  98. // [InternalError]()
  99. // [QuotaError]()
  100. // [RangeError]()
  101. // [RequestError]()
  102. rpc GenerateAudienceCompositionInsights(GenerateAudienceCompositionInsightsRequest) returns (GenerateAudienceCompositionInsightsResponse) {
  103. option (google.api.http) = {
  104. post: "/v12/customers/{customer_id=*}:generateAudienceCompositionInsights"
  105. body: "*"
  106. };
  107. option (google.api.method_signature) = "customer_id,audience,dimensions";
  108. }
  109. }
  110. // Request message for [AudienceInsightsService.GenerateInsightsFinderReport][google.ads.googleads.v12.services.AudienceInsightsService.GenerateInsightsFinderReport].
  111. message GenerateInsightsFinderReportRequest {
  112. // Required. The ID of the customer.
  113. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  114. // Required. A baseline audience for this report, typically all people in a region.
  115. BasicInsightsAudience baseline_audience = 2 [(google.api.field_behavior) = REQUIRED];
  116. // Required. The specific audience of interest for this report. The insights in the
  117. // report will be based on attributes more prevalent in this audience than
  118. // in the report's baseline audience.
  119. BasicInsightsAudience specific_audience = 3 [(google.api.field_behavior) = REQUIRED];
  120. // The name of the customer being planned for. This is a user-defined value.
  121. string customer_insights_group = 4;
  122. }
  123. // The response message for
  124. // [AudienceInsightsService.GenerateInsightsFinderReport][google.ads.googleads.v12.services.AudienceInsightsService.GenerateInsightsFinderReport], containing the
  125. // shareable URL for the report.
  126. message GenerateInsightsFinderReportResponse {
  127. // An HTTPS URL providing a deep link into the Insights Finder UI with the
  128. // report inputs filled in according to the request.
  129. string saved_report_url = 1;
  130. }
  131. // Request message for
  132. // [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v12.services.AudienceInsightsService.GenerateAudienceCompositionInsights].
  133. message GenerateAudienceCompositionInsightsRequest {
  134. // Required. The ID of the customer.
  135. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  136. // Required. The audience of interest for which insights are being requested.
  137. InsightsAudience audience = 2 [(google.api.field_behavior) = REQUIRED];
  138. // The one-month range of historical data to use for insights, in the format
  139. // "yyyy-mm". If unset, insights will be returned for the last thirty days of
  140. // data.
  141. string data_month = 3;
  142. // Required. The audience dimensions for which composition insights should be returned.
  143. repeated google.ads.googleads.v12.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimensions = 4 [(google.api.field_behavior) = REQUIRED];
  144. // The name of the customer being planned for. This is a user-defined value.
  145. string customer_insights_group = 5;
  146. }
  147. // Response message for
  148. // [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v12.services.AudienceInsightsService.GenerateAudienceCompositionInsights].
  149. message GenerateAudienceCompositionInsightsResponse {
  150. // The contents of the insights report, organized into sections.
  151. // Each section is associated with one of the AudienceInsightsDimension values
  152. // in the request. There may be more than one section per dimension.
  153. repeated AudienceCompositionSection sections = 1;
  154. }
  155. // Request message for
  156. // [AudienceInsightsService.ListAudienceInsightsAttributes][google.ads.googleads.v12.services.AudienceInsightsService.ListAudienceInsightsAttributes].
  157. message ListAudienceInsightsAttributesRequest {
  158. // Required. The ID of the customer.
  159. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  160. // Required. The types of attributes to be returned.
  161. repeated google.ads.googleads.v12.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimensions = 2 [(google.api.field_behavior) = REQUIRED];
  162. // Required. A free text query. Attributes matching or related to this string will be
  163. // returned.
  164. string query_text = 3 [(google.api.field_behavior) = REQUIRED];
  165. // The name of the customer being planned for. This is a user-defined value.
  166. string customer_insights_group = 4;
  167. // If SUB_COUNTRY_LOCATION attributes are one of the requested dimensions and
  168. // this field is present, then the SUB_COUNTRY_LOCATION attributes returned
  169. // will be located in these countries. If this field is absent, then location
  170. // attributes are not filtered by country. Setting this field when
  171. // SUB_COUNTRY_LOCATION attributes are not requested will return an error.
  172. repeated google.ads.googleads.v12.common.LocationInfo location_country_filters = 5;
  173. }
  174. // Response message for
  175. // [AudienceInsightsService.ListAudienceInsightsAttributes][google.ads.googleads.v12.services.AudienceInsightsService.ListAudienceInsightsAttributes].
  176. message ListAudienceInsightsAttributesResponse {
  177. // The attributes matching the search query.
  178. repeated AudienceInsightsAttributeMetadata attributes = 1;
  179. }
  180. // Request message for [AudienceInsightsService.ListAudienceInsightsDates][].
  181. message ListInsightsEligibleDatesRequest {
  182. }
  183. // Response message for [AudienceInsightsService.ListAudienceInsightsDates][].
  184. message ListInsightsEligibleDatesResponse {
  185. // The months for which AudienceInsights data is currently
  186. // available, each represented as a string in the form "YYYY-MM".
  187. repeated string data_months = 1;
  188. }
  189. // An audience attribute that can be used to request insights about the
  190. // audience.
  191. message AudienceInsightsAttribute {
  192. // An audience attribute.
  193. oneof attribute {
  194. // An audience attribute defined by an age range.
  195. google.ads.googleads.v12.common.AgeRangeInfo age_range = 1;
  196. // An audience attribute defined by a gender.
  197. google.ads.googleads.v12.common.GenderInfo gender = 2;
  198. // An audience attribute defined by a geographic location.
  199. google.ads.googleads.v12.common.LocationInfo location = 3;
  200. // An Affinity or In-Market audience.
  201. google.ads.googleads.v12.common.UserInterestInfo user_interest = 4;
  202. // An audience attribute defined by interest in a topic represented by a
  203. // Knowledge Graph entity.
  204. AudienceInsightsEntity entity = 5;
  205. // An audience attribute defined by interest in a Product & Service
  206. // category.
  207. AudienceInsightsCategory category = 6;
  208. // A YouTube Dynamic Lineup
  209. AudienceInsightsDynamicLineup dynamic_lineup = 7;
  210. // A Parental Status value (parent, or not a parent).
  211. google.ads.googleads.v12.common.ParentalStatusInfo parental_status = 8;
  212. // A household income percentile range.
  213. google.ads.googleads.v12.common.IncomeRangeInfo income_range = 9;
  214. // A YouTube channel.
  215. google.ads.googleads.v12.common.YouTubeChannelInfo youtube_channel = 10;
  216. }
  217. }
  218. // An entity or category representing a topic that defines an audience.
  219. message AudienceInsightsTopic {
  220. // An entity or category attribute.
  221. oneof topic {
  222. // A Knowledge Graph entity
  223. AudienceInsightsEntity entity = 1;
  224. // A Product & Service category
  225. AudienceInsightsCategory category = 2;
  226. }
  227. }
  228. // A Knowledge Graph entity, represented by its machine id.
  229. message AudienceInsightsEntity {
  230. // Required. The machine id (mid) of the Knowledge Graph entity.
  231. string knowledge_graph_machine_id = 1 [(google.api.field_behavior) = REQUIRED];
  232. }
  233. // A Product and Service category.
  234. message AudienceInsightsCategory {
  235. // Required. The criterion id of the category.
  236. string category_id = 1 [(google.api.field_behavior) = REQUIRED];
  237. }
  238. // A YouTube Dynamic Lineup.
  239. message AudienceInsightsDynamicLineup {
  240. // Required. The numeric ID of the dynamic lineup.
  241. string dynamic_lineup_id = 1 [(google.api.field_behavior) = REQUIRED];
  242. }
  243. // A description of an audience used for requesting insights.
  244. message BasicInsightsAudience {
  245. // Required. The countries for this audience.
  246. repeated google.ads.googleads.v12.common.LocationInfo country_location = 1 [(google.api.field_behavior) = REQUIRED];
  247. // Sub-country geographic location attributes. If present, each of these
  248. // must be contained in one of the countries in this audience.
  249. repeated google.ads.googleads.v12.common.LocationInfo sub_country_locations = 2;
  250. // Gender for the audience. If absent, the audience does not restrict by
  251. // gender.
  252. google.ads.googleads.v12.common.GenderInfo gender = 3;
  253. // Age ranges for the audience. If absent, the audience represents all people
  254. // over 18 that match the other attributes.
  255. repeated google.ads.googleads.v12.common.AgeRangeInfo age_ranges = 4;
  256. // User interests defining this audience. Affinity and In-Market audiences
  257. // are supported.
  258. repeated google.ads.googleads.v12.common.UserInterestInfo user_interests = 5;
  259. // Topics, represented by Knowledge Graph entities and/or Product & Service
  260. // categories, that this audience is interested in.
  261. repeated AudienceInsightsTopic topics = 6;
  262. }
  263. // An audience attribute, with metadata about it, returned in response to a
  264. // search.
  265. message AudienceInsightsAttributeMetadata {
  266. // The type of the attribute.
  267. google.ads.googleads.v12.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimension = 1;
  268. // The attribute itself.
  269. AudienceInsightsAttribute attribute = 2;
  270. // The human-readable name of the attribute.
  271. string display_name = 3;
  272. // A relevance score for this attribute, between 0 and 1.
  273. double score = 4;
  274. // A string that supplements the display_name to identify the attribute.
  275. // If the dimension is TOPIC, this is a brief description of the
  276. // Knowledge Graph entity, such as "American singer-songwriter".
  277. // If the dimension is CATEGORY, this is the complete path to the category in
  278. // The Product & Service taxonomy, for example
  279. // "/Apparel/Clothing/Outerwear".
  280. string display_info = 5;
  281. // Metadata specific to the dimension of this attribute.
  282. oneof dimension_metadata {
  283. // Special metadata for a YouTube channel.
  284. YouTubeChannelAttributeMetadata youtube_channel_metadata = 6;
  285. // Special metadata for a YouTube Dynamic Lineup.
  286. DynamicLineupAttributeMetadata dynamic_attribute_metadata = 7;
  287. // Special metadata for a Location.
  288. LocationAttributeMetadata location_attribute_metadata = 8;
  289. }
  290. }
  291. // Metadata associated with a YouTube channel attribute.
  292. message YouTubeChannelAttributeMetadata {
  293. // The approximate number of subscribers to the YouTube channel.
  294. int64 subscriber_count = 1;
  295. }
  296. // Metadata associated with a Dynamic Lineup attribute.
  297. message DynamicLineupAttributeMetadata {
  298. // The national market associated with the lineup.
  299. google.ads.googleads.v12.common.LocationInfo inventory_country = 1;
  300. // The median number of impressions per month on this lineup.
  301. optional int64 median_monthly_inventory = 2;
  302. // The lower end of a range containing the number of channels in the lineup.
  303. optional int64 channel_count_lower_bound = 3;
  304. // The upper end of a range containing the number of channels in the lineup.
  305. optional int64 channel_count_upper_bound = 4;
  306. }
  307. // Metadata associated with a Location attribute.
  308. message LocationAttributeMetadata {
  309. // The country location of the sub country location.
  310. google.ads.googleads.v12.common.LocationInfo country_location = 1;
  311. }
  312. // A set of users, defined by various characteristics, for which insights can
  313. // be requested in AudienceInsightsService.
  314. message InsightsAudience {
  315. // Required. The countries for the audience.
  316. repeated google.ads.googleads.v12.common.LocationInfo country_locations = 1 [(google.api.field_behavior) = REQUIRED];
  317. // Sub-country geographic location attributes. If present, each of these
  318. // must be contained in one of the countries in this audience. If absent, the
  319. // audience is geographically to the country_locations and no further.
  320. repeated google.ads.googleads.v12.common.LocationInfo sub_country_locations = 2;
  321. // Gender for the audience. If absent, the audience does not restrict by
  322. // gender.
  323. google.ads.googleads.v12.common.GenderInfo gender = 3;
  324. // Age ranges for the audience. If absent, the audience represents all people
  325. // over 18 that match the other attributes.
  326. repeated google.ads.googleads.v12.common.AgeRangeInfo age_ranges = 4;
  327. // Parental status for the audience. If absent, the audience does not
  328. // restrict by parental status.
  329. google.ads.googleads.v12.common.ParentalStatusInfo parental_status = 5;
  330. // Household income percentile ranges for the audience. If absent, the
  331. // audience does not restrict by household income range.
  332. repeated google.ads.googleads.v12.common.IncomeRangeInfo income_ranges = 6;
  333. // Dynamic lineups representing the YouTube content viewed by the audience.
  334. repeated AudienceInsightsDynamicLineup dynamic_lineups = 7;
  335. // A combination of entity, category and user interest attributes defining the
  336. // audience. The combination has a logical AND-of-ORs structure: Attributes
  337. // within each InsightsAudienceAttributeGroup are combined with OR, and
  338. // the combinations themselves are combined together with AND. For example,
  339. // the expression (Entity OR Affinity) AND (In-Market OR Category) can be
  340. // formed using two InsightsAudienceAttributeGroups with two Attributes
  341. // each.
  342. repeated InsightsAudienceAttributeGroup topic_audience_combinations = 8;
  343. }
  344. // A list of AudienceInsightsAttributes.
  345. message InsightsAudienceAttributeGroup {
  346. // Required. A collection of audience attributes to be combined with logical OR.
  347. // Attributes need not all be the same dimension. Only Knowledge Graph
  348. // entities, Product & Service Categories, and Affinity and In-Market
  349. // audiences are supported in this context.
  350. repeated AudienceInsightsAttribute attributes = 1 [(google.api.field_behavior) = REQUIRED];
  351. }
  352. // A collection of related attributes of the same type in an audience
  353. // composition insights report.
  354. message AudienceCompositionSection {
  355. // The type of the attributes in this section.
  356. google.ads.googleads.v12.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension dimension = 1;
  357. // The most relevant segments for this audience. If dimension is GENDER,
  358. // AGE_RANGE or PARENTAL_STATUS, then this list of attributes is exhaustive.
  359. repeated AudienceCompositionAttribute top_attributes = 3;
  360. // Additional attributes for this audience, grouped into clusters. Only
  361. // populated if dimension is YOUTUBE_CHANNEL.
  362. repeated AudienceCompositionAttributeCluster clustered_attributes = 4;
  363. }
  364. // A collection of related attributes, with metadata and metrics, in an audience
  365. // composition insights report.
  366. message AudienceCompositionAttributeCluster {
  367. // The name of this cluster of attributes
  368. string cluster_display_name = 1;
  369. // If the dimension associated with this cluster is YOUTUBE_CHANNEL, then
  370. // cluster_metrics are metrics associated with the cluster as a whole.
  371. // For other dimensions, this field is unset.
  372. AudienceCompositionMetrics cluster_metrics = 3;
  373. // The individual attributes that make up this cluster, with metadata and
  374. // metrics.
  375. repeated AudienceCompositionAttribute attributes = 4;
  376. }
  377. // The share and index metrics associated with an attribute in an audience
  378. // composition insights report.
  379. message AudienceCompositionMetrics {
  380. // The fraction (from 0 to 1 inclusive) of the baseline audience that match
  381. // the attribute.
  382. double baseline_audience_share = 1;
  383. // The fraction (from 0 to 1 inclusive) of the specific audience that match
  384. // the attribute.
  385. double audience_share = 2;
  386. // The ratio of audience_share to baseline_audience_share, or zero if this
  387. // ratio is undefined or is not meaningful.
  388. double index = 3;
  389. // A relevance score from 0 to 1 inclusive.
  390. double score = 4;
  391. }
  392. // An audience attribute with metadata and metrics.
  393. message AudienceCompositionAttribute {
  394. // The attribute with its metadata.
  395. AudienceInsightsAttributeMetadata attribute_metadata = 1;
  396. // Share and index metrics for the attribute.
  397. AudienceCompositionMetrics metrics = 2;
  398. }