无论我做什么,我都无法拉出我帐户上的所有广告。我的最终目标是以编程方式在帐户中查找被拒登的广告,但无论我使用哪种过滤器(即使我不使用过滤器),我只能从帐户中的 181 个广告中检索到 59 个。有人可以更正我的 XML 请求吗?这是我目前使用的代码,它返回 181 个中的 59 个。
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Reporting/v13" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://bingads.microsoft.com/Reporting/v13">
<env:Header>
<AuthenticationToken>****</AuthenticationToken>
<CustomerAccountId>****</CustomerAccountId>
<CustomerId>****</CustomerId>
<DeveloperToken>****</DeveloperToken>
</env:Header>
<env:Body>
<tns:SubmitGenerateReportRequest>
<ReportRequest xsi:nil="false" xsi:type="AdPerformanceReportRequest">
<ExcludeColumnHeaders>true</ExcludeColumnHeaders>
<ExcludeReportFooter>true</ExcludeReportFooter>
<ExcludeReportHeader>true</ExcludeReportHeader>
<Format>Csv</Format>
<Language>English</Language>
<ReportName>AdPerformanceReportRequest</ReportName>
<ReturnOnlyCompleteData>false</ReturnOnlyCompleteData>
<Aggregation>Summary</Aggregation>
<Columns>
<AdPerformanceReportColumn>AdId</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdGroupName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>Spend</AdPerformanceReportColumn>
</Columns>
<Filter xsi:nil="true"/>
<Scope>
<AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>****</a1:long>
</AccountIds>
</Scope>
<Time>
<CustomDateRangeEnd>
<Day>25</Day>
<Month>06</Month>
<Year>2020</Year>
</CustomDateRangeEnd>
<CustomDateRangeStart>
<Day>25</Day>
<Month>06</Month>
<Year>2020</Year>
</CustomDateRangeStart>
<PredefinedTime xsi:nil="true"/>
<ReportTimeZone>EasternTimeUSCanada</ReportTimeZone>
</Time>
</ReportRequest>
</tns:SubmitGenerateReportRequest>
</env:Body>
</env:Envelope>
这会返回准确的数据,我将返回的广告的支出相加,它们与界面中的数字完全匹配。我怀疑API默认只返回带有性能数据的行,所以我用展示次数> 0的广告过滤了界面中的广告,恰好是59。我不知道这是否是巧合,但是我真的需要拉出帐户上的所有广告,因为显然被拒登的广告不会有任何展示。
当我尝试使用过滤器时,我根据AdPerformanceReportFilter的文档格式化请求,并得到如下所示的内容
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Reporting/v13" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://bingads.microsoft.com/Reporting/v13">
<env:Header>
...
<Columns>
<AdPerformanceReportColumn>AdId</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdGroupName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>Spend</AdPerformanceReportColumn>
</Columns>
<Filter>
<AdStatus>Paused</AdStatus>
</Filter>
<Scope>
<AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>****</a1:long>
</AccountIds>
</Scope>
...
这会返回 0 个广告,但是当我检查界面时,有很多暂停的广告。实际上有 81 个暂停的广告。
如果我使用 Pending、Rejected、Deleted 或 Paused,它将返回 0 个广告。指定 Active 给我通常的 59。你能告诉我如何从没有性能数据的 API 中提取行吗?
谢谢你。