That's what I was guessing would be the case. I've navigated around it by
writing a very simple processor (PHP) to parse a list of keywords and
attempt to identify the user's intention. Suggestions for improvement
welcome.
---
static function ProcessExpertKeywordList($keywords) {
// Explode keyword list
$keywords = explode("\n", $keywords);
// If empty, die.
if (empty($keywords))
return false;
foreach ($keywords as $keyword):
// Clean up submitted keyword
$keyword = trim($keyword);
if (empty($keyword)): continue; endif;
// Assume defaults
$match_type = 'BROAD';
$criterion_use = 'BIDDIBLE';
// Example: [foobar]
if (preg_match('/^\[/', $keyword)):
$match_type = 'EXACT';
endif;
// Example: "foobar"
if (preg_match('/^\"/', $keyword)):
$match_type = 'PHRASE';
endif;
// Example: -foobar
if (preg_match('/^-/', $keyword)):
$criterion_use = 'NEGATIVE';
endif;
// Example: -[foobar]
if (preg_match('/^-\[/', $keyword)):
$criterion_use = 'NEGATIVE';
$match_type = 'EXACT';
endif;
// Example: -"foobar"
if (preg_match('/^-\"/', $keyword)):
$criterion_use = 'NEGATIVE';
$match_type = 'PHRASE';
endif;
// Remove the extra markup from the text, build return array
$text = str_replace(array('[',']','"','-'), '', $keyword);
$return[] = array('submitted' => $keyword, 'text' => $text,
'matchType' => $match_type, 'criterionUse' => $criterion_use);
endforeach;
return $return;
}
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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