Hi Prasad, The statsSelector needs to be set on the AdGroupCriterionSelector, not the service.
http://code.google.com/apis/adwords/v2009/docs/reference/AdGroupCriterionService.AdGroupCriterionSelector.html#statsSelector Best, - Eric Koleda, AdWords API Team On Mar 23, 12:38 am, prasad darla <darla.prasad....@gmail.com> wrote: > Hi All, > > We recently undertook changes to move to the v2009 API. We use the PHP > library. Most of our code has been modified and it works fine. I was > able to create and update new Campaign etc. I also got Campaign stats > using the new CampaignService. However I am unable to get the > criterion stats as per the new API AdGroupCriterionService. I get > other information about the criteria including the text, its max bid > etc but the Criteria stats like Impressions, Clicks are always empty. > > Here is my code snippet: > > <code> > $newAdGroupCriteriaService = $user->GetAdGroupCriterionService('v200909'); > > $newAdGroupCriteriaService->statsSelector = new statsSelector(); > $newAdGroupCriteriaService->statsSelector->dateRange = new > DateRange($startDate,$endDate); > > $KIDSelector = new AdGroupCriterionSelector(); > // Create id filter. > $idFilter = new AdGroupCriterionIdFilter(); > $idFilter->criterionId = $KID; > $KIDSelector->idFilters = array($idFilter); > > $keywordStats = $newAdGroupCriteriaService->get($KIDSelector); > > print_r($keywordStats); > </code> > > The KeywordStats printed contains relevant information about the > Criteria but no stats. The stat objects startDate amd endDate fields > are always empty and so are the stats. > > AdGroupCriterionPage Object ( [entries] => Array ( [0] => > BiddableAdGroupCriterion Object ( [userStatus] => ACTIVE > [systemServingStatus] => ELIGIBLE [approvalStatus] => APPROVED > [destinationUrl] => [bids] => ManualCPCAdGroupCriterionBids Object > ( [maxCpc] => Bid Object ( [amount] => Money Object ( [microAmount] => > 660000 [ComparableValueType] => Money [_parameterMap:private] => Array > ( [ComparableValue.Type] => ComparableValueType ) ) ) [bidSource] => > CRITERION [positionPreferenceBids] => [AdGroupCriterionBidsType] => > ManualCPCAdGroupCriterionBids [_parameterMap:private] => Array > ( [AdGroupCriterionBids.Type] => AdGroupCriterionBidsType ) ) > [firstPageCpc] => Bid Object ( [amount] => Money Object > ( [microAmount] => 10000 [ComparableValueType] => Money > [_parameterMap:private] => Array ( [ComparableValue.Type] => > ComparableValueType ) ) ) [qualityInfo] => QualityInfo Object > ( [isKeywordAdRelevanceAcceptable] => 1 > [isLandingPageQualityAcceptable] => 1 [isLandingPageLatencyAcceptable] > => 1 [qualityScore] => 10 ) [stats] => Stats Object ( [startDate] => > [endDate] => [network] => SEARCH [clicks] => [impressions] => [cost] > => [averagePosition] => [averageCpc] => [averageCpm] => [ctr] => > [conversions] => [conversionRate] => [costPerConversion] => > [conversionsManyPerClick] => [conversionRateManyPerClick] => > [costPerConversionManyPerClick] => [StatsType] => Stats > [_parameterMap:private] => Array ( [Stats.Type] => StatsType ) ) > [adGroupId] => 98347538458[criterion] => Keyword Object ( [text] => my > keyword text [matchType] => PHRASE [id] => 634776627363 > [CriterionType] => Keyword [_parameterMap:private] => Array > ( [Criterion.Type] => CriterionType ) ) [AdGroupCriterionType] => > BiddableAdGroupCriterion [_parameterMap:private] => Array > ( [AdGroupCriterion.Type] => AdGroupCriterionType ) ) ) > [totalNumEntries] => 1 [PageType] => AdGroupCriterionPage > [_parameterMap:private] => Array ( [Page.Type] => PageType ) ) > > Can anyone throw any light on this? I think its mostly a problem with > the AdGroupCriterionService usage and hence I am posting the query > here. Please let me know if you need any other information. > > Thanks in advance, > Prasad -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. 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 To unsubscribe from this group, send email to adwords-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.