admob_resources.proto 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. // Copyright 2020 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.admob.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/type/date.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/ads/admob/v1;admob";
  20. option java_outer_classname = "AdMobResourcesProto";
  21. option java_package = "com.google.ads.admob.v1";
  22. // The sorting order.
  23. enum SortOrder {
  24. // Default value for an unset field. Do not use.
  25. SORT_ORDER_UNSPECIFIED = 0;
  26. // Sort dimension value or metric value in ascending order.
  27. ASCENDING = 1;
  28. // Sort dimension value or metric value in descending order.
  29. DESCENDING = 2;
  30. }
  31. // A publisher account contains information relevant to the use of this API,
  32. // such as the time zone used for the reports.
  33. message PublisherAccount {
  34. option (google.api.resource) = {
  35. type: "admob.googleapis.com/PublisherAccount"
  36. pattern: "accounts/{publisher}"
  37. };
  38. // Resource name of this account.
  39. // Format is accounts/{publisher_id}.
  40. string name = 1;
  41. // The unique ID by which this publisher account can be identified
  42. // in the API requests (for example, pub-1234567890).
  43. string publisher_id = 2;
  44. // The time zone that is used in reports that are generated for this account.
  45. // The value is a time-zone ID as specified by the CLDR project,
  46. // for example, "America/Los_Angeles".
  47. string reporting_time_zone = 3;
  48. // Currency code of the earning-related metrics, which is the 3-letter code
  49. // defined in ISO 4217. The daily average rate is used for the currency
  50. // conversion.
  51. string currency_code = 4;
  52. }
  53. // The specification for generating an AdMob Network report.
  54. // For example, the specification to get clicks and estimated earnings for only
  55. // the 'US' and 'CN' countries can look like the following example:
  56. //
  57. // {
  58. // 'date_range': {
  59. // 'start_date': {'year': 2018, 'month': 9, 'day': 1},
  60. // 'end_date': {'year': 2018, 'month': 9, 'day': 30}
  61. // },
  62. // 'dimensions': ['DATE', 'APP', 'COUNTRY'],
  63. // 'metrics': ['CLICKS', 'ESTIMATED_EARNINGS'],
  64. // 'dimension_filters': [
  65. // {
  66. // 'dimension': 'COUNTRY',
  67. // 'matches_any': {'values': [{'value': 'US', 'value': 'CN'}]}
  68. // }
  69. // ],
  70. // 'sort_conditions': [
  71. // {'dimension':'APP', order: 'ASCENDING'},
  72. // {'metric':'CLICKS', order: 'DESCENDING'}
  73. // ],
  74. // 'localization_settings': {
  75. // 'currency_code': 'USD',
  76. // 'language_code': 'en-US'
  77. // }
  78. // }
  79. //
  80. // For a better understanding, you can treat the preceding specification like
  81. // the following pseudo SQL:
  82. //
  83. // SELECT DATE, APP, COUNTRY, CLICKS, ESTIMATED_EARNINGS
  84. // FROM NETWORK_REPORT
  85. // WHERE DATE >= '2018-09-01' AND DATE <= '2018-09-30'
  86. // AND COUNTRY IN ('US', 'CN')
  87. // GROUP BY DATE, APP, COUNTRY
  88. // ORDER BY APP ASC, CLICKS DESC;
  89. message NetworkReportSpec {
  90. // Describes which report rows to match based on their dimension values.
  91. message DimensionFilter {
  92. // Filter operator to be applied.
  93. oneof operator {
  94. // Matches a row if its value for the specified dimension is in one of the
  95. // values specified in this condition.
  96. StringList matches_any = 2;
  97. }
  98. // Applies the filter criterion to the specified dimension.
  99. Dimension dimension = 1;
  100. }
  101. // Sorting direction to be applied on a dimension or a metric.
  102. message SortCondition {
  103. // Identifies which values to sort on.
  104. oneof sort_on {
  105. // Sort by the specified dimension.
  106. Dimension dimension = 1;
  107. // Sort by the specified metric.
  108. Metric metric = 2;
  109. }
  110. // Sorting order of the dimension or metric.
  111. SortOrder order = 3;
  112. }
  113. // The dimensions of the network report. Dimensions are data attributes to
  114. // break down or refine the quantitative measurements (metrics) by certain
  115. // attributes, such as the ad format or the platform an ad was viewed on.
  116. enum Dimension {
  117. // Default value for an unset field. Do not use.
  118. DIMENSION_UNSPECIFIED = 0;
  119. // A date in the YYYY-MM-DD format (for example, "2018-12-21"). Requests can
  120. // specify at most one time dimension.
  121. DATE = 1;
  122. // A month in the YYYY-MM format (for example, "2018-12"). Requests can
  123. // specify at most one time dimension.
  124. MONTH = 2;
  125. // The date of the first day of a week in the YYYY-MM-DD format
  126. // (for example, "2018-12-21"). Requests can specify at most one time
  127. // dimension.
  128. WEEK = 3;
  129. // The unique ID of the ad unit (for example, "ca-app-pub-1234/1234").
  130. // If AD_UNIT dimension is specified, then APP is included automatically.
  131. AD_UNIT = 4;
  132. // The unique ID of the mobile application (for example,
  133. // "ca-app-pub-1234~1234").
  134. APP = 5;
  135. // Type of the ad (for example, "text" or "image"), an ad delivery
  136. // dimension.
  137. //
  138. // **Warning:** The dimension is incompatible with
  139. // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS),
  140. // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and
  141. // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics.
  142. AD_TYPE = 6;
  143. // CLDR country code of the place where the ad views/clicks occur (for
  144. // example, "US" or "FR"). This is a geography dimension.
  145. COUNTRY = 7;
  146. // Format of the ad unit (for example, "banner", "native"), an ad delivery
  147. // dimension.
  148. FORMAT = 8;
  149. // Mobile OS platform of the app (for example, "Android" or "iOS").
  150. PLATFORM = 9;
  151. }
  152. // The metrics of the network report. Metrics are quantitative measurements
  153. // indicating how the publisher business is performing. They are aggregated
  154. // from the individual ad events and grouped by the report dimensions. The
  155. // metric value is either integer, or decimal (without rounding).
  156. enum Metric {
  157. // Default value for an unset field. Do not use.
  158. METRIC_UNSPECIFIED = 0;
  159. // The number of ad requests. The value is an integer.
  160. //
  161. // **Warning:** The metric is incompatible with
  162. // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
  163. AD_REQUESTS = 1;
  164. // The number of times a user clicks an ad. The value is an integer.
  165. CLICKS = 2;
  166. // The estimated earnings of the AdMob publisher. The currency unit (USD,
  167. // EUR, or other) of the earning metrics are determined by the localization
  168. // setting for currency. The amount is in micros. For example, $6.50 would
  169. // be represented as 6500000.
  170. ESTIMATED_EARNINGS = 3;
  171. // The total number of ads shown to users. The value is an integer.
  172. IMPRESSIONS = 4;
  173. // The ratio of clicks over impressions. The value is a double precision
  174. // (approximate) decimal value.
  175. IMPRESSION_CTR = 5;
  176. // The estimated earnings per thousand ad impressions. The value is in
  177. // micros. For example, $1.03 would be represented as 1030000.
  178. //
  179. // **Warning:** The metric is incompatible with
  180. // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
  181. IMPRESSION_RPM = 6;
  182. // The number of times ads are returned in response to a request. The value
  183. // is an integer.
  184. MATCHED_REQUESTS = 7;
  185. // The ratio of matched ad requests over the total ad requests. The value is
  186. // a double precision (approximate) decimal value.
  187. //
  188. // **Warning:** The metric is incompatible with
  189. // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
  190. MATCH_RATE = 8;
  191. // The ratio of ads that are displayed over ads that are returned, defined
  192. // as impressions / matched requests. The value is a double precision
  193. // (approximate) decimal value.
  194. SHOW_RATE = 9;
  195. }
  196. // The date range for which the report is generated.
  197. DateRange date_range = 1;
  198. // List of dimensions of the report. The value combination of these dimensions
  199. // determines the row of the report. If no dimensions are specified, the
  200. // report returns a single row of requested metrics for the entire account.
  201. repeated Dimension dimensions = 2;
  202. // List of metrics of the report. A report must specify at least one metric.
  203. repeated Metric metrics = 3;
  204. // Describes which report rows to match based on their dimension values.
  205. repeated DimensionFilter dimension_filters = 4;
  206. // Describes the sorting of report rows. The order of the condition in the
  207. // list defines its precedence; the earlier the condition, the higher its
  208. // precedence. If no sort conditions are specified, the row ordering is
  209. // undefined.
  210. repeated SortCondition sort_conditions = 5;
  211. // Localization settings of the report.
  212. LocalizationSettings localization_settings = 6;
  213. // Maximum number of report data rows to return. If the value is not set, the
  214. // API returns as many rows as possible, up to 100000. Acceptable values are
  215. // 1-100000, inclusive. Any other values are treated as 100000.
  216. int32 max_report_rows = 7;
  217. // A report time zone. Accepts an IANA TZ name values, such as
  218. // "America/Los_Angeles." If no time zone is defined, the account default
  219. // takes effect. Check default value by the get account action.
  220. //
  221. // **Warning:** The "America/Los_Angeles" is the only supported value at
  222. // the moment.
  223. string time_zone = 8;
  224. }
  225. // The specification for generating an AdMob Mediation report.
  226. // For example, the specification to get observed ECPM sliced by ad source and
  227. // app for the 'US' and 'CN' countries can look like the following example:
  228. //
  229. // {
  230. // "date_range": {
  231. // "start_date": {"year": 2018, "month": 9, "day": 1},
  232. // "end_date": {"year": 2018, "month": 9, "day": 30}
  233. // },
  234. // "dimensions": ["AD_SOURCE", "APP", "COUNTRY"],
  235. // "metrics": ["OBSERVED_ECPM"],
  236. // "dimension_filters": [
  237. // {
  238. // "dimension": "COUNTRY",
  239. // "matches_any": {"values": [{"value": "US", "value": "CN"}]}
  240. // }
  241. // ],
  242. // "sort_conditions": [
  243. // {"dimension":"APP", order: "ASCENDING"}
  244. // ],
  245. // "localization_settings": {
  246. // "currency_code": "USD",
  247. // "language_code": "en-US"
  248. // }
  249. // }
  250. //
  251. // For a better understanding, you can treat the preceding specification like
  252. // the following pseudo SQL:
  253. //
  254. // SELECT AD_SOURCE, APP, COUNTRY, OBSERVED_ECPM
  255. // FROM MEDIATION_REPORT
  256. // WHERE DATE >= '2018-09-01' AND DATE <= '2018-09-30'
  257. // AND COUNTRY IN ('US', 'CN')
  258. // GROUP BY AD_SOURCE, APP, COUNTRY
  259. // ORDER BY APP ASC;
  260. message MediationReportSpec {
  261. // Describes which report rows to match based on their dimension values.
  262. message DimensionFilter {
  263. // Filter operator to be applied.
  264. oneof operator {
  265. // Matches a row if its value for the specified dimension is in one of the
  266. // values specified in this condition.
  267. StringList matches_any = 2;
  268. }
  269. // Applies the filter criterion to the specified dimension.
  270. Dimension dimension = 1;
  271. }
  272. // Sorting direction to be applied on a dimension or a metric.
  273. message SortCondition {
  274. // Identifies which values to sort on.
  275. oneof sort_on {
  276. // Sort by the specified dimension.
  277. Dimension dimension = 1;
  278. // Sort by the specified metric.
  279. Metric metric = 2;
  280. }
  281. // Sorting order of the dimension or metric.
  282. SortOrder order = 3;
  283. }
  284. // The dimensions of the mediation report. Dimensions are data attributes to
  285. // break down or refine the quantitative measurements (metrics) by certain
  286. // attributes, such as the ad format or the platform an ad was viewed on.
  287. enum Dimension {
  288. // Default value for an unset field. Do not use.
  289. DIMENSION_UNSPECIFIED = 0;
  290. // A date in the YYYY-MM-DD format (for example, "2018-12-21"). Requests can
  291. // specify at most one time dimension.
  292. DATE = 1;
  293. // A month in the YYYY-MM format (for example, "2018-12"). Requests can
  294. // specify at most one time dimension.
  295. MONTH = 2;
  296. // The date of the first day of a week in the YYYY-MM-DD format
  297. // (for example, "2018-12-21"). Requests can specify at most one time
  298. // dimension.
  299. WEEK = 3;
  300. // The [unique ID of the ad source](/admob/api/v1/ad_sources) (for example,
  301. // "5450213213286189855" and "AdMob Network" as label value).
  302. AD_SOURCE = 4;
  303. // The unique ID of the ad source instance (for example,
  304. // "ca-app-pub-1234#5678" and "AdMob (default)" as label value).
  305. AD_SOURCE_INSTANCE = 5;
  306. // The unique ID of the ad unit (for example, "ca-app-pub-1234/8790").
  307. // If AD_UNIT dimension is specified, then APP is included automatically.
  308. AD_UNIT = 6;
  309. // The unique ID of the mobile application (for example,
  310. // "ca-app-pub-1234~1234").
  311. APP = 7;
  312. // The unique ID of the mediation group (for example,
  313. // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value).
  314. MEDIATION_GROUP = 11;
  315. // CLDR country code of the place where the ad views/clicks occur (for
  316. // example, "US" or "FR"). This is a geography dimension.
  317. COUNTRY = 8;
  318. // Format of the ad unit (for example, "banner", "native"), an ad delivery
  319. // dimension.
  320. FORMAT = 9;
  321. // Mobile OS platform of the app (for example, "Android" or "iOS").
  322. PLATFORM = 10;
  323. }
  324. // The metrics of the mediation report. Metrics are quantitative measurements
  325. // indicating how the publisher business is performing. They are aggregated
  326. // from the individual ad events and grouped by the report dimensions. The
  327. // metric value is either integer, or decimal (without rounding).
  328. enum Metric {
  329. // Default value for an unset field. Do not use.
  330. METRIC_UNSPECIFIED = 0;
  331. // The number of requests. The value is an integer.
  332. AD_REQUESTS = 1;
  333. // The number of times a user clicks an ad. The value is an integer.
  334. CLICKS = 2;
  335. // The estimated earnings of the AdMob publisher. The currency unit (USD,
  336. // EUR, or other) of the earning metrics are determined by the localization
  337. // setting for currency. The amount is in micros. For example, $6.50 would
  338. // be represented as 6500000.
  339. //
  340. // Estimated earnings per mediation group and per ad source instance level
  341. // is supported dating back to October 20, 2019. Third-party estimated
  342. // earnings will show 0 for dates prior to October 20, 2019.
  343. ESTIMATED_EARNINGS = 3;
  344. // The total number of ads shown to users. The value is an integer.
  345. IMPRESSIONS = 4;
  346. // The ratio of clicks over impressions. The value is a double precision
  347. // (approximate) decimal value.
  348. IMPRESSION_CTR = 5;
  349. // The number of times ads are returned in response to a request. The value
  350. // is an integer.
  351. MATCHED_REQUESTS = 6;
  352. // The ratio of matched ad requests over the total ad requests. The value is
  353. // a double precision (approximate) decimal value.
  354. MATCH_RATE = 7;
  355. // The third-party ad network's estimated average eCPM. The currency unit
  356. // (USD, EUR, or other) of the earning metrics are determined by the
  357. // localization setting for currency. The amount is in micros. For example,
  358. // $2.30 would be represented as 2300000.
  359. //
  360. // The estimated average eCPM per mediation group and per ad source instance
  361. // level is supported dating back to October 20, 2019. Third-party estimated
  362. // average eCPM will show 0 for dates prior to October 20, 2019.
  363. OBSERVED_ECPM = 8;
  364. }
  365. // The date range for which the report is generated.
  366. DateRange date_range = 1;
  367. // List of dimensions of the report. The value combination of these dimensions
  368. // determines the row of the report. If no dimensions are specified, the
  369. // report returns a single row of requested metrics for the entire account.
  370. repeated Dimension dimensions = 2;
  371. // List of metrics of the report. A report must specify at least one metric.
  372. repeated Metric metrics = 3;
  373. // Describes which report rows to match based on their dimension values.
  374. repeated DimensionFilter dimension_filters = 4;
  375. // Describes the sorting of report rows. The order of the condition in the
  376. // list defines its precedence; the earlier the condition, the higher its
  377. // precedence. If no sort conditions are specified, the row ordering is
  378. // undefined.
  379. repeated SortCondition sort_conditions = 5;
  380. // Localization settings of the report.
  381. LocalizationSettings localization_settings = 6;
  382. // Maximum number of report data rows to return. If the value is not set, the
  383. // API returns as many rows as possible, up to 100000. Acceptable values are
  384. // 1-100000, inclusive. Any other values are treated as 100000.
  385. int32 max_report_rows = 7;
  386. // A report time zone. Accepts an IANA TZ name values, such as
  387. // "America/Los_Angeles." If no time zone is defined, the account default
  388. // takes effect. Check default value by the get account action.
  389. //
  390. // **Warning:** The "America/Los_Angeles" is the only supported value at
  391. // the moment.
  392. string time_zone = 8;
  393. }
  394. // A row of the returning report.
  395. message ReportRow {
  396. // Representation of a dimension value.
  397. message DimensionValue {
  398. // Dimension value in the format specified in the report's spec Dimension
  399. // enum.
  400. string value = 1;
  401. // The localized string representation of the value. If unspecified, the
  402. // display label should be derived from the value.
  403. string display_label = 2;
  404. }
  405. // Representation of a metric value.
  406. message MetricValue {
  407. // Metric value in the format specified in the report's spec Metric enum
  408. // name.
  409. oneof value {
  410. // Metric integer value.
  411. int64 integer_value = 1;
  412. // Double precision (approximate) decimal values. Rates are from 0 to 1.
  413. double double_value = 2;
  414. // Amount in micros. One million is equivalent to one unit. Currency value
  415. // is in the unit (USD, EUR or other) specified by the request.
  416. // For example, $6.50 whould be represented as 6500000 micros.
  417. int64 micros_value = 3;
  418. }
  419. }
  420. // Map of dimension values in a row, with keys as enum name of the dimensions.
  421. map<string, DimensionValue> dimension_values = 1;
  422. // Map of metric values in a row, with keys as enum name of the metrics. If
  423. // a metric being requested has no value returned, the map will not include
  424. // it.
  425. map<string, MetricValue> metric_values = 2;
  426. }
  427. // Warnings associated with generation of the report.
  428. message ReportWarning {
  429. // Warning type.
  430. enum Type {
  431. // Default value for an unset field. Do not use.
  432. TYPE_UNSPECIFIED = 0;
  433. // Some data in this report is aggregated based on a time zone different
  434. // from the requested time zone. This could happen if a local time-zone
  435. // report has the start time before the last time this time zone changed.
  436. // The description field will contain the date of the last time zone
  437. // change.
  438. DATA_BEFORE_ACCOUNT_TIMEZONE_CHANGE = 1;
  439. // There is an unusual delay in processing the source data for the
  440. // requested date range. The report results might be less up to date than
  441. // usual. AdMob is aware of the issue and is actively working to resolve
  442. // it.
  443. DATA_DELAYED = 2;
  444. // Warnings that are exposed without a specific type. Useful when new
  445. // warning types are added but the API is not changed yet.
  446. OTHER = 3;
  447. // The currency being requested is not the account currency. The earning
  448. // metrics will be based on the requested currency, and thus not a good
  449. // estimation of the final payment anymore, due to the currency rate
  450. // fluctuation.
  451. REPORT_CURRENCY_NOT_ACCOUNT_CURRENCY = 4;
  452. }
  453. // Type of the warning.
  454. Type type = 1;
  455. // Describes the details of the warning message, in English.
  456. string description = 2;
  457. }
  458. // Groups data helps to treat the generated report. Always sent as a first
  459. // message in the stream response.
  460. message ReportHeader {
  461. // The date range for which the report is generated. This is identical to the
  462. // range specified in the report request.
  463. DateRange date_range = 1;
  464. // Localization settings of the report. This is identical to the settings
  465. // in the report request.
  466. LocalizationSettings localization_settings = 2;
  467. // The report time zone. The value is a time-zone ID as specified by the CLDR
  468. // project, for example, "America/Los_Angeles".
  469. string reporting_time_zone = 3;
  470. }
  471. // Groups data available after report generation, for example, warnings and row
  472. // counts. Always sent as the last message in the stream response.
  473. message ReportFooter {
  474. // Warnings associated with generation of the report.
  475. repeated ReportWarning warnings = 1;
  476. // Total number of rows that matched the request.
  477. //
  478. // Warning: This count does NOT always match the number of rows in the
  479. // response. Do not make that assumption when processing the response.
  480. int64 matching_row_count = 2;
  481. }
  482. // Specification of a single date range. Both dates are inclusive.
  483. message DateRange {
  484. // Start date of the date range, inclusive. Must be less than or equal to the
  485. // end date.
  486. google.type.Date start_date = 1;
  487. // End date of the date range, inclusive. Must be greater than or equal to the
  488. // start date.
  489. google.type.Date end_date = 2;
  490. }
  491. // Localization settings for reports, such as currency and language. It affects
  492. // how metrics are calculated.
  493. message LocalizationSettings {
  494. // Currency code of the earning related metrics, which is the 3-letter code
  495. // defined in ISO 4217. The daily average rate is used for the currency
  496. // conversion. Defaults to the account currency code if unspecified.
  497. string currency_code = 1;
  498. // Language used for any localized text, such as some dimension value display
  499. // labels. The language tag defined in the IETF BCP47. Defaults to 'en-US' if
  500. // unspecified.
  501. string language_code = 2;
  502. }
  503. // List of string values.
  504. message StringList {
  505. // The string values.
  506. repeated string values = 1;
  507. }