Hi!

I tryed make a ACCOUNT_PERFORMANCE_REPORT with cross client settings,
when I set the client selector, the report doesn't work.

I use the aw_api_php_lib_2.5.1 PHP Client Library with this code:

        $reportService = $this->apiUser-
>GetReportDefinitionService('v201101');

        $ad1_pred = new Predicate();
        $ad1_pred->field = 'ConversionRate';
        $ad1_pred->operator = 'GREATER_THAN';
        $ad1_pred->values = 0.27;

        $selector = new Selector();
        $selector->fields =
array('ExternalCustomerId','Cost','Clicks','AveragePosition','Conversions');
        $selector->predicates = array($ad1_pred);

        $reportDefinition = new ReportDefinition();
        $reportDefinition->reportName =
'sync_dashboard_'.date("Y_m_d_H_i_s");
        $reportDefinition->dateRangeType = 'THIS_MONTH';
        $reportDefinition->reportType = 'ACCOUNT_PERFORMANCE_REPORT';
        $reportDefinition->crossClient = true;
        $reportDefinition->downloadFormat = 'XML';
        $reportDefinition->selector = $selector;

        $clientSelectors = array();

        $clientSelector = new ClientSelector();
        $clientSelector->login = '****';
        $clientSelectors[] = $clientSelector;

        $reportDefinition->clientSelectors = $clientSelectors;


        $operation = new ReportDefinitionOperation();
        $operation->operand = $reportDefinition;
        $operation->operator = 'ADD';
        $operations = array($operation);

        $result = $reportService->mutate($operations);


Please help me, what make I wrong.

SOAP log:

[Apr 14 2011 11:33:39.000000 - INFO] POST /api/adwords/cm/v201101/
ReportDefinitionService HTTP/1.1
Host: adwords.google.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.9, gzip
Accept-Encoding: gzip, deflate
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 884

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/
v201101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <SOAP-ENV:Header>
    <ns1:RequestHeader xsi:type="ns1:RequestHeader">
      <ns1:authToken>*****</ns1:authToken>
      <ns1:clientEmail>*****</ns1:clientEmail>
      <ns1:developerToken>*****</ns1:developerToken>
      <ns1:userAgent>*****</ns1:userAgent>
    </ns1:RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:mutate>
      <ns1:operations>
        <ns1:operator>ADD</ns1:operator>
        <ns1:operand>
          <ns1:selector>
            <ns1:fields>ExternalCustomerId</ns1:fields>
            <ns1:fields>Cost</ns1:fields>
            <ns1:fields>Clicks</ns1:fields>
            <ns1:fields>AveragePosition</ns1:fields>
            <ns1:fields>Conversions</ns1:fields>
            <ns1:predicates>
              <ns1:field>ConversionRate</ns1:field>
              <ns1:operator>GREATER_THAN</ns1:operator>
              <ns1:values>0.27</ns1:values>
            </ns1:predicates>
          </ns1:selector>
          <ns1:reportName>sync_dashboard_2011_04_14_11_33_38</
ns1:reportName>
          <ns1:reportType>ACCOUNT_PERFORMANCE_REPORT</ns1:reportType>
          <ns1:dateRangeType>THIS_MONTH</ns1:dateRangeType>
          <ns1:downloadFormat>XML</ns1:downloadFormat>
          <ns1:crossClient>true</ns1:crossClient>
          <ns1:clientSelectors>
            <ns1:login>*****</ns1:login>
          </ns1:clientSelectors>
        </ns1:operand>
      </ns1:operations>
    </ns1:mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Encoding: gzip
Transfer-Encoding: chunked
Date: Thu, 14 Apr 2011 09:33:47 GMT
Expires: Thu, 14 Apr 2011 09:33:47 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Header>
    <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/
v201101">
      <requestId>26ac9b767d307bf9626cf32c6dd29736</requestId>
      <operations>1</operations>
      <responseTime>487</responseTime>
      <units>400</units>
    </ResponseHeader>
  </soap:Header>
  <soap:Body>
    <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/
v201101">
      <rval>
        <id>29277513</id>
        <selector>
          <fields>ExternalCustomerId</fields>
          <fields>Cost</fields>
          <fields>Clicks</fields>
          <fields>AveragePosition</fields>
          <fields>Conversions</fields>
          <predicates>
            <field>ConversionRate</field>
            <operator>GREATER_THAN</operator>
            <values>0.27</values>
          </predicates>
        </selector>
        <reportName>sync_dashboard_2011_04_14_11_33_38</reportName>
        <reportType>ACCOUNT_PERFORMANCE_REPORT</reportType>
        <hasAttachment>false</hasAttachment>
        <dateRangeType>THIS_MONTH</dateRangeType>
        <downloadFormat>XML</downloadFormat>
        <creationTime>20110414 023347 America/Los_Angeles</
creationTime>
        <crossClient>true</crossClient>
        <clientSelectors>
          <login>*****</login>
        </clientSelectors>
      </rval>
    </mutateResponse>
  </soap:Body>
</soap:Envelope>

The downloaded report XML:

<reportResponse>
  <queryToken>null</queryToken>
  <state>FAILURE</state>
  <failureReason>Unexpected exception</failureReason>
</reportResponse>

Thanks Robert!

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to