0

我正在尝试过滤 Bing Ads Api 中的 SearchQueryPerformanceReport,我可以正常获取报告,但是我想通过多个 CampaignStatus 过滤报告

例如

var report = new SearchQueryPerformanceReportRequest
            {
                Aggregation = aggregation,
                ExcludeColumnHeaders = excludeColumnHeaders,
                ExcludeReportFooter = excludeReportFooter,
                ExcludeReportHeader = excludeReportHeader,
                Format = ReportFileFormat,
                ReturnOnlyCompleteData = returnOnlyCompleteData,
                Time = time,
                ReportName = "My Search Query Performance Report",
                Scope = new AccountThroughAdGroupReportScope
                {
                    AccountIds = new[] { accountId }
                },
                Filter = new SearchQueryPerformanceReportFilter
                {    
                    CampaignStatus = CampaignStatusReportFilter.Active,
                    AdGroupStatus = AdGroupStatusReportFilter.Active
                },
                Columns = new[]
                {
                    SearchQueryPerformanceReportColumn.SearchQuery,
                    SearchQueryPerformanceReportColumn.Clicks,
                    SearchQueryPerformanceReportColumn.Spend,
                    SearchQueryPerformanceReportColumn.Conversions,
                    SearchQueryPerformanceReportColumn.Revenue,
                    SearchQueryPerformanceReportColumn.CampaignId,
                    SearchQueryPerformanceReportColumn.CampaignName,
                    SearchQueryPerformanceReportColumn.AdGroupId,
                    SearchQueryPerformanceReportColumn.AdGroupName
                },
            };

现在我想获取不是 CampaignStatusReportFilter.Deleted 的每个 CampaignStatus。文档说我应该能够做到这一点。在我看来它应该看起来像这样,但这显然是不正确的。

 Filter = new SearchQueryPerformanceReportFilter
            {    
                CampaignStatus = CampaignStatusReportFilter.Active,
                CampaignStatus = CampaignStatusReportFilter.Paused,
                AdGroupStatus = AdGroupStatusReportFilter.Active
            },

或者

Filter = new SearchQueryPerformanceReportFilter
            {    
                CampaignStatus = !CampaignStatusReportFilter.Deleted,
                AdGroupS
4

1 回答 1

0

对于列表类型,您可以包含多个值作为标志。如何指定多个标志取决于您使用的编程语言。例如,C# 将这些值视为标志值,而 Java 将它们视为字符串数组。这是 C# 中的一个片段:

CampaignStatus = CampaignStatusReportFilter.Active | CampaignStatusReportFilter.Paused

SOAP 应该包含一个字符串,该字符串包含一个以空格分隔的值列表,例如:

<CampaignStatus>Active Paused</CampaignStatus>
于 2020-02-07T19:34:15.047 回答