here is my final code:

        *$adGroupCriterionService = $adWordsServices->get($session, 
AdGroupCriterionService::class);*

*        $operations = [];*

*        $keyword = new Keyword();*
*        $keyword->setId($criterionId);*

*        $adGroupCriterion = new BiddableAdGroupCriterion();*
*        $adGroupCriterion->setAdGroupId($adGroupId);*
*        $adGroupCriterion->setCriterion($keyword);*
*        $adGroupCriterion->setBidModifier(1.5);*

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

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

*        $adGroupCriterion = $result->getValue()[0];*

*        $data = array(*
*            "message" => "Keyword with ID %d has updated final URL ",*
*            "id"      => $adGroupCriterion->getCriterion()->getId()*
*        );*

*        array_push(self::$keywords, $data);*

And I am not using SOAP.

The error is:


*<br />*
*<b>Fatal error</b>:  Uncaught 
Google\AdsApi\AdWords\v201806\cm\ApiException: 
[CriterionError.CANNOT_BID_MODIFY_CRITERION_TYPE @ 
operations[0].operand.bidModifier] in 
/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:43*
*Stack trace:*
*#0 
/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(43):
 
ReflectionClass-&gt;newInstanceArgs(Array)*
*#1 
/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(202):
 
Google\AdsApi\Common\Util\Reflection-&gt;createInstance('Google\\AdsApi\\A...', 
Array)*
*#2 
/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(164):
 
Google\AdsApi\Common\AdsSoapClient-&gt;parseApiExceptionFromSoapFault(Object(SoapFault))*
*#3 
/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/v201806/cm/AdGroupCriterionService.php(198
 
in*
*<b>/Applications/MAMP/htdocs/native_adwords/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php</b>
 
on line*
*<b>43</b>*
*<br />*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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
--- 
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/840a131c-7cd5-4f43-b8a0-b4fe0e41f533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Ken Dan Tinio
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... Ken Dan Tinio
    • ... Ken Dan Tinio
    • ... Ken Dan Tinio
      • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to