Hi Daniel,

As for the AdHoc reports, please see this 
guide<https://developers.google.com/adwords/api/docs/guides/reporting> and 
example<https://code.google.com/p/google-api-adwords-php/source/browse/examples/AdWords/v201302/Reporting/DownloadCriteriaReport.php>on
 how to pull AdHoc reports using PHP client library. 

As for the stats discrepancy, can you please share the request and response 
xml? 
If you don't want to share it, please reply only to me with "Reply to 
author" from the box in the top right corner.

Best,
- Takeshi, AdWords API Team

On Tuesday, July 30, 2013 5:15:29 PM UTC+9, Daniel van der Ende wrote:
>
> Hi Takeshi,
>
> Thanks! I had not found documentation for the AdHoc reports, these do seem 
> to be a better option. I did not manage, however, to get the statistics 
> correctly using my previous method. I checked the dateRanges and these are 
> correct. The difference also seems to be completely disproportionate; we 
> are getting statistics that are a factor 1000 times as high for a single 
> day as the statistics shown in the client center shows for the same ad for 
> its entire date range.
>
> Kind Regards,
>
> Daniel van der Ende
>
> On Wednesday, 10 July 2013 13:03:43 UTC+2, Takeshi Hagikura (AdWords API 
> Team) wrote:
>>
>> Hi, 
>>
>> Can you please make sure you are requesting the exactly same dateRange, 
>> predicates and fields for the UI and API again?
>> If there is still a difference, please share the request and response 
>> soap xml logs and the stats from the UI.
>>
>> FYI: I recommend to use AdHoc reports to retrieve stats, it take less 
>> time for the stats to be fixed and it can be filtered/segmented in a more 
>> flexible way.
>>
>> Best,
>> - Takeshi, AdWords API Team
>>
>> On Monday, July 8, 2013 9:56:46 PM UTC+9, Daniel van der Ende wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to read out statistics for our ads and adgroups using the PHP 
>>> API for Google Adwords. I'm having some trouble, however, getting the 
>>> correct values for impressions, clicks and cost.
>>> I'm using the following code:
>>>
>>>         $user->SetClientCustomerId($clientId);
>>> $adService = $user->GetService("AdGroupAdService", ADWORDS_VERSION);
>>> $selector = new Selector();
>>> $selector->fields = array("Id", "Name", "Clicks", "Impressions", "Cost");
>>> $selector->predicates[] = new Predicate("AdGroupId", "IN", 
>>> array($adGroupId));
>>>        // DateRange is previously defined for another API call, which 
>>> returns the correct values.
>>> $selector->dateRange = $dateRange;
>>> $selector->paging = new Paging(0, 
>>> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>>> do {
>>>     // Make the get request.
>>>     $page = $adService->get($selector);
>>>
>>>     if (isset($page->entries)) { 
>>> foreach ($page->entries as $ad) {
>>> $newLineObject->adName = $ad->name;
>>> $newLineObject->clicks = $ad->ad->AdStats->clicks;
>>> $newLineObject->impressions = $ad->adStats->impressions;
>>> $newLineObject->cost = $ad->ad->AdStats->cost->microAmount/ 
>>> AdWordsConstants::MICROS_PER_DOLLAR;
>>> }
>>>     }
>>>     else {
>>>       print "No matching ads were found.\n";
>>>      }
>>> $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>>>
>>> } while ($page->totalNumEntries > $selector->paging->startIndex);
>>>
>>> This obviously isn't the entire code, but other elements are not related 
>>> to the adwords api. When I print the values obtained, I'm getting vastly 
>>> different figures for impressions, clicks and cost than I can find in my 
>>> client center. For example, for a single ad in my client center I see 12000 
>>> impressions, whereas the figure returned by the API indicates almost 
>>> 2000000 impressions.
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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/groups/opt_out.


Reply via email to