AI-generated Key Takeaways
- 
          The endpoint POST https://admob.googleapis.com/v1beta/{parent=accounts/*}/campaignReport:generateis used to generate a campaign report.
- 
          The report generation requires specifying a reportSpecin the request body, which includes details like date range, dimensions, and metrics.
- 
          The dimensions define how the report data is sliced (e.g., by campaign ID, date, country). 
- 
          The metrics define the performance indicators included in the report (e.g., impressions, clicks, installs). 
- 
          The response body contains the generated report data in rows, with each row representing a combination of the specified dimensions and their corresponding metric values. 
- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- CampaignReportSpec
- Dimension
- Metric
- Examples
- Try it!
Generates Campaign Report based on provided specifications.
HTTP request
POST https://admob.googleapis.com/v1beta/{parent=accounts/*}/campaignReport:generate
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
| parent | 
 Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 | 
Request body
The request body contains data with the following structure:
| JSON representation | 
|---|
| {
  "reportSpec": {
    object ( | 
| Fields | |
|---|---|
| reportSpec | 
 Campaign report specification. | 
Response body
Campaign Report API response.
If successful, the response body contains data with the following structure:
| JSON representation | 
|---|
| {
  "rows": [
    {
      object ( | 
| Fields | |
|---|---|
| rows[] | 
 The campaign report data from the specified publisher. At most 100000 rows will be returned from the API. | 
Authorization scopes
Requires one of the following OAuth scopes:
- https://www.googleapis.com/auth/admob.readonly
- https://www.googleapis.com/auth/admob.report
For more information, see the OAuth 2.0 Overview.
CampaignReportSpec
The specification for generating a Campaign report. For example, the specification to get IMPRESSIONS and CLICKS sliced by CAMPAIGN_ID can look like the following example:
{
  "dateRange": {
    "startDate": {"year": 2021, "month": 12, "day": 1},
    "endDate": {"year": 2021, "month": 12, "day": 30}
  },
  "dimensions": ["CAMPAIGN_ID"],
  "metrics": ["IMPRESSIONS", "CLICKS"],
}
| JSON representation | 
|---|
| { "dateRange": { object ( | 
| Fields | |
|---|---|
| dateRange | 
 The date range for which the report is generated. The max range is 30 days. | 
| dimensions[] | 
 List of dimensions of the report. The value combination of these dimensions determines the row of the report. If no dimensions are specified, the report returns a single row of requested metrics for the entire account. | 
| metrics[] | 
 List of metrics of the report. A report must specify at least one metric. | 
| languageCode | 
 Language used for any localized text, such as certain applicable dimension values. The language tag is defined in the IETF BCP47. Defaults to 'en-US' if unspecified or invalid. | 
Dimension
The dimensions of the campaign report.
| Enums | |
|---|---|
| DIMENSION_UNSPECIFIED | Default value of an unspecified dimension. Do not use. | 
| DATE | A date in the YYYYMMDD format (for example, "20210701"). | 
| CAMPAIGN_ID | The unique ID of the campaign, for example "123456789", which is consistent with the campaign id from campaign list api. | 
| CAMPAIGN_NAME | The name of the campaign. | 
| AD_ID | The unique ID of the ad, for example "123456789". | 
| AD_NAME | The name of the ad, which may not be unique. | 
| PLACEMENT_ID | The vendor-specific unique ID of the app where the ad is placed. For example, com.goog.bar for Android and 123456789 for iOS apps. | 
| PLACEMENT_NAME | The name of the app where the ad is placed. | 
| PLACEMENT_PLATFORM | The platform of the app where the ad is placed. | 
| COUNTRY | The name of the targeted country. | 
| FORMAT | Format of the ad unit (for example, "banner", "native"), an ad delivery dimension. | 
Metric
The metrics of the campaign report.
| Enums | |
|---|---|
| METRIC_UNSPECIFIED | Default value for an unset field. Do not use. | 
| IMPRESSIONS | The number of times an ad is shown to the user. | 
| CLICKS | The number of times a user clicks an ad. | 
| CLICK_THROUGH_RATE | The number of clicks an ad receives divided by the number of times the ad is shown. | 
| INSTALLS | The number of times apps were downloaded to devices. | 
| ESTIMATED_COST | The estimated cost of serving a campaign ad instead of an ad that earns revenue. The currency is the reporting currency for campaigns. | 
| AVERAGE_CPI | The average cost per install. This means the average amount that was spent to acquire a new user. The currency is the reporting currency for campaigns. | 
| INTERACTIONS | The number of times a user interacts with an ad. This consists of clicks and engagements. |