Hello,
I'm updating the portfolio bidding strategy (in the code below setUpdate is 
called) :

// if biddingStrategyName is null, set it to campaignId
if ($biddingStrategyResourceName)
{
    $biddingStrategy = new BiddingStrategy([
        'resource_name' => $biddingStrategyResourceName
    ]);
}
else
{
    $biddingStrategy = new BiddingStrategy([
        'name' => new StringValue(['value' => $campaignId])
    ]);
}


$biddingStrategy->setType($type);

if ($type === BiddingStrategyType::TARGET_ROAS)
{
    $targetRoas = new TargetRoas(['target_roas' => $bid]);
    $biddingStrategy->setTargetRoas($targetRoas);
}
else
{
    $money = new Money();
    $bidValue = new Int64Value();
    $bidValue->setValue($bid);
    $money->setAmountMicros($bidValue);
    $targetSpa = new TargetCpa(['target_cpa_micros' => 
$money->getAmountMicros()]);
    $biddingStrategy->setTargetCpa($targetSpa);
}
// create operation
$biddingStrategyOperation =  new BiddingStrategyOperation();
if ($biddingStrategyResourceName)
{
    
$biddingStrategyOperation->setUpdateMask(FieldMasks::allSetFieldsOf($biddingStrategy));
    $biddingStrategyOperation->setUpdate($biddingStrategy);
}
else
{
    $biddingStrategyOperation->setCreate($biddingStrategy);
}

$response = 
$this->biddingStrategyService->mutateBiddingStrategies($this->account_google_id,
 [$biddingStrategyOperation]);

/** @var BiddingStrategy $mutatedBiddingStrategy */
$mutatedBiddingStrategy = $response->getResults()[0];
return $mutatedBiddingStrategy->getResourceName();


Getting the following error:



Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: 
{"errors":[{"errorCode":{"fieldError":"FIELD_CANNOT_BE_CLEARED"},"message":"The 
field cannot be cleared.","location":

{"fieldPathElements":[{"fieldName":"operations","index":"0"},{"fieldName":"update"},{"fieldName":"target_cpa"},{"fieldName":"cpc_bid_floor_micros"}]}}]}
  


What is the reason? Why cpc_bid_floor_micros can not be cleared?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/06987656-09d5-44cd-80e6-52a3c8fc44de%40googlegroups.com.

Reply via email to