Hey there,

I'm trying to change the MatchType of an existing keyword using the 
following code:

$adWordsServices = new AdWordsServices();
$adGroupCriterionService = $adWordsServices->get($this->session->get("
adwordsSession"), AdGroupCriterionService::class);
$criterion = new Keyword();
$criterion->setId($keywordId);

if ($matchType == 'broad') {
$criterion->setMatchType(KeywordMatchType::BROAD);
} else if ($matchType == 'exact') {
$criterion->setMatchType(KeywordMatchType::EXACT);
} else {
$criterion->setMatchType(KeywordMatchType::PHRASE);
}
$criterion->setText($text);

// Create an ad group criterion.
$adGroupCriterion = new BiddableAdGroupCriterion();
$adGroupCriterion->setCriterion($criterion);
$adGroupCriterion->setAdGroupId($adGroupId);
// Create an ad group criterion operation and add it the operations list.
$operation = new AdGroupCriterionOperation();
$operation->setOperand($adGroupCriterion);
$operation->setOperator(Operator::SET);
$operations = [$operation];

$result = $adGroupCriterionService->mutate($operations);

But when I execute this, nothing changes. The keywords matchType just stays 
the same, without any error or exception.

Does anyone know how to do this right, or where my mistake is?

Thanks so much in advance!
Lukas

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f89c97aa-db7a-47d8-b0b2-a7a3cd7a9f1c%40googlegroups.com.

Reply via email to