Adwords PHP API带条件不工作
我试图限制我在报告中得到的宣传活动,以便我只得到那些以“反恐委员会”开头的宣传活动Adwords PHP API带条件不工作,php,api,google-ads-api,Php,Api,Google Ads Api,我试图限制我在报告中得到的宣传活动,以便我只得到那些以“反恐委员会”开头的宣传活动 $user->LoadService("ReportDefinitionService"); $selector = new Selector(); $selector->fields = $report["fields"]; $selector->dateRange = new DateRange($api_date, $api_date); $selector->withCondit
$user->LoadService("ReportDefinitionService");
$selector = new Selector();
$selector->fields = $report["fields"];
$selector->dateRange = new DateRange($api_date, $api_date);
$selector->withCondition = "Name STARTS_WITH 'CTC'";
$reportDefinition = new ReportDefinition();
$reportDefinition->reportName = 'my_made_up_name_' . time();
$reportDefinition->dateRangeType = "CUSTOM_DATE";
$reportDefinition->reportType = $report["type"];
$reportDefinition->downloadFormat = "GZIPPED_CSV";
$reportDefinition->selector = $selector;
我不确定我是否有语法错误,我正在使用此页作为参考
我得到的错误是:
发生错误:报告下载失败。潜在的错误是
类型='ReportDownloadError.INVALID_REPORT_DEFINITION_XML',触发器=
'无效的ReportDefinition Xml:cvc复杂类型。2.4.a:无效内容
已找到以元素“withCondition”开头的。什么之中的一个
“{”:排序,
“:paging}”是
应为“”,字段路径=“”
提前感谢,
詹姆斯
$selector->withCondition = "Name STARTS_WITH 'CTC'";
$selector = new Selector();
$selector->fields = $report["fields"];
$selector->dateRange = new DateRange($api_date, $api_date);
//$selector->withCondition = "Name STARTS_WITH 'CTC'";
$selector->predicates[] = new Predicate('CampaignName', 'STARTS_WITH', 'CTC');