Ah okay that wasn't clear to me.  Thank you!

On Thursday, May 29, 2014 7:32:40 AM UTC-6, Michael Cloonan (AdWords API 
Team) wrote:
>
> Hello,
>
> The 
> ReportDefinitionService<https://developers.google.com/adwords/api/docs/reference/v201402/ReportDefinitionService>
>  is 
> not meant for running reports, but rather for fetching information about 
> what fields are supported in different reports. We also make all this 
> information on our Report 
> Types<https://developers.google.com/adwords/api/docs/appendix/reports>page, 
> so you can avoid using this service altogether by referencing this 
> page.
>
> In order to actually run a report, please see our Reporting 
> Basics<https://developers.google.com/adwords/api/docs/guides/reporting>guide. 
> You can also look at any of our PHP 
> Reporting<https://github.com/googleads/googleads-php-lib/tree/master/examples/AdWords/v201402/Reporting>examples.
>
> I recommend using 
> AWQL<https://developers.google.com/adwords/api/docs/guides/awql>to fetch 
> reports, which is a SQL-like language specifically for AdWords. 
> For example, you could do something like this:
>
> SELECT Id, Ctr
> FROM AD_PERFORMANCE_REPORT
> WHERE CampaignId IN (...)
> DURING 20140501,20140529
> ORDER BY Ctr DESC
> LIMIT 0,50
>
> You can add whatever fields/predicates/timeframe you like. Both ordering 
> and paging do work when running the report, just not when fetching report 
> definitions.
>
> Regards,
> Mike, AdWords API Team
>
> On Wednesday, May 28, 2014 6:51:47 PM UTC-4, Jake Wilson wrote:
>>
>> I'm looking at all the ads for a campaign.  I want to fetch the top 
>> performing ad from the campaign.  By top performing I guess I would choose 
>> the ad with the highest CTR maybe?  Or maybe the Conversion rate.  Anyways, 
>> I'm doing this kind of thing:
>>
>> $user = new AdWordsUser();
>> $user->setClientCustomerId($accountId);
>> $user->LoadService('ReportDefinitionService', ADWORDS_VERSION);
>>
>> $selector = new Selector();
>> $selector->fields = array(.....);
>> $selector->predicates[] = new Predicate('CampaignId', 'IN', $campaignIds);
>>
>> $reportDefinition = new ReportDefinition();
>> $reportDefinition->selector = $selector;
>> $reportDefinition->reportName = 'Ad performance report #' . uniqid();
>> $reportDefinition->dateRangeType = "LAST_30_DAYS";
>> $reportDefinition->reportType = 'AD_PERFORMANCE_REPORT';
>> $reportDefinition->downloadFormat = 'XML';
>> $reportDefinition->includeZeroImpressions = FALSE;
>>
>> The problem with this API call is that it returns ALL the ads (218 ads 
>> for this particular campaign I'm testing on).  And I don't think the ads 
>> are sorted in any logical way that I can see.  Maybe by adID ascending.
>>
>> Anyways, I tried to add two things to my selector:
>>
>> $selector->ordering[] = new OrderBy('Ctr', 'DESCENDING');
>>
>> Gives the error:
>>
>> *Report download failed. Underlying errors are Type = 
>> 'ReportDefinitionError.SORTING_NOT_SUPPORTED', Trigger = 'Sorting is not 
>> supported for reports', FieldPath = ''.*
>>
>>
>> Also, in order to just return the first result only (which work work if I 
>> could get ordering to work), I tried using paging:
>>
>> $selector->paging = new Paging(0,1);
>>
>> But I get 
>>
>> *Report download failed. Underlying errors are Type = 
>> 'ReportDefinitionError.PAGING_NOT_SUPPORTED', Trigger = 'Paging is not 
>> supported for reports', FieldPath = ''.*
>>
>> Okay so downloading reports supports neight ordering or paging/limiting? 
>>  Am I only able to just fetch ALL the ads and I need to manually sort 
>> through them myself?  That doesn't seem right...
>>
>> Am I missing something here?
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to