我正在使用 Google Adwords API 测试帐户测试报告使用情况。我有以下代码来下载广告组效果报告:
ReportDefinition definition = new ReportDefinition()
{
reportName = "Adgroup Report",
reportType = ReportDefinitionReportType.ADGROUP_PERFORMANCE_REPORT,
downloadFormat = DownloadFormat.CSVFOREXCEL,
dateRangeType = ReportDefinitionDateRangeType.YESTERDAY,
selector = new Selector
{
fields = new string[] { "Clicks" }
}
};
ReportUtilities utilities = new ReportUtilities(user) { ReportVersion = "v201206" };
ClientReport report = utilities.DownloadClientReport(definition, reportPath);
我收到以下错误:
无效的 ReportDefinition Xml:cvc-complex-type.2.4.a:发现以元素“选择器”开头的无效内容。'{" https://adwords.google.com/api/adwords/cm/v201206 ":id, " https://adwords.google.com/api/adwords/cm/v201206 ":selector}' 之一是预期的。
我错过了什么?