In adCenter API V5, the entire reporting API has been redesigned. The following are the key elements of the new API.
New Reporting Methods
New and Renamed Report Types
Report Columns and Measures
You must now specify all the report data columns that you want in a report. All the columns and measures are specified by using the same property. Each of the report request classes has a Columns property that is an array of enumeration values that specifies the requested data. Even though these columns appear to be optional, the array requires some of the columns. Each Columns property will identify which columns are required. For example, in the keyword performance report request, the KeywordPerformanceReportRequest.Columns property must contain the following columns:
- KeywordPerformanceReportColumn.AccountName
- KeywordPerformanceReportColumn.CampaignName
- KeywordPerformanceReportColumn.Keyword
- KeywordPerformanceReportColumn.TimePeriod
This property must also contain at least one of the following values:
- KeywordPerformanceReportColumn.AverageCpc
- KeywordPerformanceReportColumn.AveragePosition
- KeywordPerformanceReportColumn.Clicks
- KeywordPerformanceReportColumn.Ctr
- KeywordPerformanceReportColumn.Impressions
- KeywordPerformanceReportColumn.Spend
The order that the columns are contained in the array determines the order that the columns will appear in the report.
Report Aggregation
Report aggregation works the same way that it does in V4. Each report request class has an Aggregation property that is set to an enumeration value. It specifies the time period to aggregate for the report. There are two types of report aggregation values—ReportAggregation and NonHourlyReportAggregation, depending on whether hourly aggregation is supported for the report type.
Report Filters
You can use filters to target a report to a reduced set of items. The items can be filtered according to the report type. Each report request type has an associated report request filter class that is contained in the request's Filter property. Only the items that fit all the filter criteria are included in the report.
For example, the KeywordPerformanceReportRequest.Filter property contains a KeywordPerformanceReportFilter object that specifies the filters for the report. You can filter a keyword performance report to a specific set of keywords by adding the keywords you want to include in the report to the KeywordPerformanceReportFilter.Keywords array. Similarly, you can limit the report results to those keywords that are displayed in a particular language and country/region by setting the KeywordPerformanceReportFilter.LanguageAndRegion property to the desired language and country/region. If both properties are set, only those keywords in the array that are displayed in the specified language and country/region will be included in the report.
Report Scope
You can now specify the scope of a report to a set of accounts, campaigns, and/or ad groups. The scope can be as narrow or as broad as you need it to be. You can even generate reports that contain data for multiple accounts, campaigns, and/or ad groups.
Each report request type has a Scope property that contains a report scope class object that defines the scope of the report. The following table lists the available scope classes.
|
Scope Class
|
Description
|
| AccountReportScope | Used for reports that can be applied only to accounts. The account performance report is an example of this type of report. |
| AccountThroughCampaignReportScope | Used for reports that can be applied only to accounts and/or campaigns. The campaign performance report is an example of this type of report. |
| AccountThroughAdGroupReportScope | Used for reports that can be applied only to accounts, campaigns, and/or ad groups. The keyword performance report is an example of this type of report. |
Report Time
The time frame of the report is specified in the Time property of the report request. All the report request types use the ReportTime class for this property except for the BudgetSummaryReportRequest.Time property, which uses the BudgetSummaryReportTime class. Both of the report time classes have the PredefinedTime, CustomDates, CustomDateRangeStart, and CustomDateRangeEnd properties. The CustomDateRangeStart and CustomDateRangeEnd properties are treated as a set to specify the range of dates and times that the report covers. Each of these properties or property sets is mutually exclusive; that is, if one property is specified, all the others must be null. For example, if the ReportTime.PredefinedTime property is not null, all the other properties must be null. If a range of dates is being specified, both the CustomDateRangeStart and CustomDateRangeEnd properties must not be null, and the PredefinedTime and CustomDates properties must be null. An error will occur if these conditions are not met.
Report Column Labels
The report column labels are now the same, no matter which type of report, XML, CSV, or TSV is requested.