NoMeasureSelected CampaignPerformanceReportRequest Microsoft Ads

NoMeasureSelected CampaignPerformanceReportRequest Microsoft Ads

我正在尝试将 Microsoft 广告设置到项目中并让 CampaignPerformanceReportRequest 处理我的项目,但我收到 NoMeasureSelected 错误.不确定问题出在哪里。 我添加了文档中提到的所有列以查看是否有效,但仍然出现相同的错误。我使用添加仪表板报告进行了测试。只需要 ImpressionTimePeriod 就可以生成成功的报告。我提出了与仪表板中的请求相匹配的请求,但仍然出现相同的错误。

项目基于 Ruby rails。

  <env:Body>
    <v13:SubmitGenerateReportRequest xmlns="https://bingads.microsoft.com/Reporting/v13">
      <v13:ReportRequest xsi:type="CampaignPerformanceReportRequest">
        <v13:ExcludeColumnHeaders>true</v13:ExcludeColumnHeaders>
        <v13:ExcludeReportFooter>true</v13:ExcludeReportFooter>
        <v13:ExcludeReportHeader>true</v13:ExcludeReportHeader>
        <v13:Format>Csv</v13:Format>
        <v13:ReportName>Test Report</v13:ReportName>
        <v13:ReturnOnlyCompleteData>false</v13:ReturnOnlyCompleteData>
        <v13:Aggregation>Summary</v13:Aggregation>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>AccountId</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>CampaignId</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>Keyword</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>KeywordId</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>DeviceType</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Columns>
          <v13:CampaignPerformanceReportColumn>Clicks</v13:CampaignPerformanceReportColumn>
        </v13:Columns>
        <v13:Filter xsi:nil="true"/>
        <v13:Scope>
          <v13:AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:long>[REDACTED]</a1:long>
          </v13:AccountIds>
        </v13:Scope>
        <v13:Time>
          <v13:CustomDateRangeEnd>
            <v13:Day>30</v13:Day>
            <v13:Month>04</v13:Month>
            <v13:Year>2022</v13:Year>
          </v13:CustomDateRangeEnd>
          <v13:CustomDateRangeStart>
            <v13:Day>01</v13:Day>
            <v13:Month>04</v13:Month>
            <v13:Year>2022</v13:Year>
          </v13:CustomDateRangeStart>
        </v13:Time>
      </v13:ReportRequest>
    </v13:SubmitGenerateReportRequest>
  </env:Body>

回复:

  <s:Body>
    <s:Fault>
      <faultcode>s:Server</faultcode>
      <faultstring>Invalid client data. Check the SOAP fault details for more information. TrackingId: 96ad1b6d-26e2-4b60-91d0-b6a68add6140.</faultstring>
      <detail>
        <ApiFaultDetail xmlns="https://bingads.microsoft.com/Reporting/v13" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <TrackingId xmlns="https://adapi.microsoft.com">96ad1b6d-26e2-4b60-91d0-b6a68add6140</TrackingId>
          <BatchErrors/>
          <OperationErrors>
            <OperationError>
              <Code>2017</Code>
              <Details i:nil="true"/>
              <ErrorCode>NoMeasureSelected</ErrorCode>
              <Message>The specified report request does not specify measurement columns (at least one is required). Please submit a report request with the required columns for this report type, and optionally additional columns that are to be included in the report.</Message>
            </OperationError>
          </OperationErrors>
        </ApiFaultDetail>
      </detail>
    </s:Fault>
  </s:Body>

有谁知道这里的问题是什么,或者有人有有效的 SOAP 请求吗?

看起来你围绕 Columns 的结构不太正确。

我认为错误 The specified report request does not specify measurement columns (at least one is required). Please submit a report request with the required columns for this report type, and optionally additional columns that are to be included in the report. 指的是 Columns 应该有多个值(即 'array')- 本身不像您的示例那样重复。

我从 reference documentation 中推断出这一点,其中 Columns 是用类型 ArrayOfCampaignPerformanceReportColumn 定义的。

<xs:element name="Columns" nillable="true" type="tns:ArrayOfCampaignPerformanceReportColumn" />

对于您的示例,这样的事情应该可行:

<env:Body>
<v13:SubmitGenerateReportRequest xmlns="https://bingads.microsoft.com/Reporting/v13">
  <v13:ReportRequest xsi:type="CampaignPerformanceReportRequest">
    <v13:ExcludeColumnHeaders>true</v13:ExcludeColumnHeaders>
    <v13:ExcludeReportFooter>true</v13:ExcludeReportFooter>
    <v13:ExcludeReportHeader>true</v13:ExcludeReportHeader>
    <v13:Format>Csv</v13:Format>
    <v13:ReportName>Test Report</v13:ReportName>
    <v13:ReturnOnlyCompleteData>false</v13:ReturnOnlyCompleteData>
    <v13:Aggregation>Summary</v13:Aggregation>
    <v13:Columns>
      <v13:CampaignPerformanceReportColumn>AccountId</v13:CampaignPerformanceReportColumn>
      <v13:CampaignPerformanceReportColumn>CampaignId</v13:CampaignPerformanceReportColumn>
      <v13:CampaignPerformanceReportColumn>Keyword</v13:CampaignPerformanceReportColumn
      <v13:CampaignPerformanceReportColumn>KeywordId</v13:CampaignPerformanceReportColumn>
      <v13:CampaignPerformanceReportColumn>DeviceType</v13:CampaignPerformanceReportColumn
      <v13:CampaignPerformanceReportColumn>Clicks</v13:CampaignPerformanceReportColumn>
    </v13:Columns>
    <v13:Filter xsi:nil="true"/>
    <v13:Scope>
      <v13:AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:long>[REDACTED]</a1:long>
      </v13:AccountIds>
    </v13:Scope>
    <v13:Time>
      <v13:CustomDateRangeEnd>
        <v13:Day>30</v13:Day>
        <v13:Month>04</v13:Month>
        <v13:Year>2022</v13:Year>
      </v13:CustomDateRangeEnd>
      <v13:CustomDateRangeStart>
        <v13:Day>01</v13:Day>
        <v13:Month>04</v13:Month>
        <v13:Year>2022</v13:Year>
      </v13:CustomDateRangeStart>
    </v13:Time>
  </v13:ReportRequest>
</v13:SubmitGenerateReportRequest>
</env:Body>