Hi Juan,
We inadvertently pushed some incorrect validation for this attribute that
affects v201109_1. V201109 should be unaffected an can be used as a
temporary workaround. We hope to have a fix for this shortly.
- Kevin Winter
AdWords API Team
On Tuesday, June 26, 2012 5:40:47 AM UTC-4, Juan Girini wrote:
>
> Hi guys,
>
> I'm getting this error randomly on API v201109_1 on Sandbox using the PHP
> library.
> I run the same script with the same data on it and sometimes it runs ok
> and sometimes I get this error:
> *
> [TargetingIdeaError.INVALID_ATTRIBUTE_TYPE @ selector; trigger:'CRITERION']
> *
>
> I call the following function which is quite simple and follows the
> GetKeywordsIdeas.php example made by Eric Koleda. Even his example has this
> random behaviour.
> In this function $keyword_item is any keyword, $requestType is 'STATS' or
> 'IDEAS' and $matchType is 'BROAD' or 'EXACT'
> *
> *
> *public function getKeywordData($keyword_item='', $requestType='',
> $matchType='') {*
>
> * $keywordIdeas = array();*
>
> * if (empty($keyword_item) || empty($requestType) ||
> empty($matchType)):*
> * return;*
> * endif;*
>
> * try {*
> * $user = new AdWordsUser();*
> * } catch (Exception $e) {*
> * $this->CI->session->set_flashdata("OPERATION_RESULT",
> $e->getMessage);*
> * return;*
> * }*
>
> * // Get the service, which loads the required classes.*
> * $targetingIdeaService =
> $user->GetService('TargetingIdeaService', $this->api_version);*
>
> * // Create seed keyword.*
>
> * $keyword = new Keyword();*
> * $keyword->text = $keyword_item;*
> * $keyword->matchType = $matchType;*
>
> * // Create selector.*
> * $selector = new TargetingIdeaSelector();*
> * $selector->requestType = $requestType;*
> * $selector->ideaType = 'KEYWORD';*
> * $selector->requestedAttributeTypes = array('CRITERION',
> 'AVERAGE_TARGETED_MONTHLY_SEARCHES', 'COMPETITION');*
> * *
>
> * $location = new Location();*
> * $location->id = '2826'; //UK *
> * $selector->searchParameters[] =*
> * new LocationSearchParameter(array($location));*
>
> * $language = new Language();*
> * $language->id = '1000'; //en *
> * $selector->searchParameters[] =*
> * new LanguageSearchParameter(array($language));*
>
> * // Create related to keyword search parameter.*
> * $selector->searchParameters[] = new
> RelatedToKeywordSearchParameter(array($keyword));*
>
> * // Create keyword match type search parameter to ensure unique
> results.*
> * $selector->searchParameters[] = new
> KeywordMatchTypeSearchParameter(array($matchType));*
>
> * // Set selector paging (required by this service).*
> * $selector->paging = new Paging(0, $this->paging);*
>
> * do {*
> * // Make the get request.*
> * try {*
> * $page = $targetingIdeaService->get($selector); //here is
> where it fails*
> * } catch (Exception $e) {*
> * $this->CI->session->set_flashdata("OPERATION_RESULT",
> "ERROR: " . $e->getMessage());*
> * return;*
> * }*
> ...
>
> Do you know why do I get this funny behaviour?
> I'd really appreciate any help, thank you!
>
> Juan
>
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en