Thank's for your answer. I get always Fatal error: Call to undefined function CountryTargetSearchParameter()
I've grep'ed the adwords api lib, and I cannot find the definition of the "CountryTargetSearchParameter"-class. It is always only extended. On 26 Dez., 15:22, jonasl <jonas+adwo...@triop.se> wrote: > Hello, > > Thanks for sharing your code Evgeniy. I needed to change a few lines: > > Remove the last line and add the following: > > $user = new AdWordsUser(); > // Log SOAP XML request and response. > $user->LogDefaults(); > // Get the TargetingIdeaService. > $targetingIdeaService = $user->GetService('TargetingIdeaService', > 'v201109'); > // Get data from Google Adwords > $page = $targetingIdeaService->get($selector); > > And change the line $selector->requestedAttributeTypes = > array('CRITERION'); to: > $selector->requestedAttributeTypes = array('CRITERION', > 'AVERAGE_TARGETED_MONTHLY_SEARCHES'); > > Thanks > Jonas Lejonhttp://triop.se > > On 24 Dec, 17:40, Evgeniy Bogdanov <bogda...@tagan.ru> wrote: > > > > > > > > > Hi. > > > This is part of my working code... > > > $returnKeywords = array(); > > // We need only keywords for United States > > $countryTarget = new CountryTarget('US', false); > > $countryTargetSearchParameter = new > > CountryTargetSearchParameter(); > > $countryTargetSearchParameter->countryTargets = > > array($countryTarget); > > > // We need only EXACT matches for keyword > > $keywordMatch = new KeywordMatchTypeSearchParameter('EXACT'); > > > // Describing selector > > $selector = new TargetingIdeaSelector(); > > $selector->requestType = 'IDEAS'; > > $selector->ideaType = 'KEYWORD'; > > $selector->requestedAttributeTypes = array('CRITERION'); > > > // We want to get only first 10 records, without keywords > > which we already have > > $paging = new Paging(); > > $paging->startIndex = (count($initialKeywords)-1); > > $paging->numberResults = 10; > > $selector->paging = $paging; > > > // Build array > > $toCheckKeywords = array(); > > foreach ($initialKeywords as &$word) { > > $toCheckKeywords[] = new Keyword($word, 'EXACT'); > > $returnKeywords[] = strtolower($word); > > } > > > // Load related keywords only > > $relatedToKeywordSearchParameter1 = new > > RelatedToKeywordSearchParameter(); > > $relatedToKeywordSearchParameter1->keywords = > > $toCheckKeywords; > > $selector->searchParameters = > > array($relatedToKeywordSearchParameter1, > > $countryTargetSearchParameter, > > $keywordMatch); > > > // Get data from Google Adwords > > $page = $this->targetingIdeaService->get($selector); > > > You need to check TARGETED_MONTHLY_SEARCHES parameter. > > > Regards, > > Evgeniy. > > > On 23 дек, 22:25, jepster <400...@googlemail.com> wrote: > > > > Hi, > > > > there are lots of examples in ADWORDS-API-PHP-FOLDER/examples/v201109 > > > - where is the example file, which gets the "exact monthly local > > > traffic value" for a keyword? I've tried the file > > > GetTrafficEstimates.php, but it isn't giving me the searched value. > > > > Hope somebody can help me, I've spend a lot of time on that.. -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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