However, when i try to set bids not using BatchJob, it works fine and all
bids are setted. What wrong with BatchJob?
public function updateKeywordsBidSingle(array $keywordsData)
{
$return = array();
try {
foreach ($keywordsData as $key => $keywordData) {
$adGroupCriterionService =
$this->getUser()->GetService('AdGroupCriterionService', self::API_VERSION);
// Create ad group criterion.
$adGroupCriterion = new BiddableAdGroupCriterion();
$adGroupCriterion->adGroupId = $keywordData['adGroupId'];
$adGroupCriterion->criterion = new Criterion($keywordData['id']);
// Set bids (optional).
$bid = new CpcBid();
$bid->bid = new Money($this->calcMoney($keywordData['bid']));
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->biddingStrategyType = 'MANUAL_CPC';
$biddingStrategyConfiguration->bids[] = $bid;
$adGroupCriterion->biddingStrategyConfiguration =
$biddingStrategyConfiguration;
// Create operation.
$operation = new AdGroupCriterionOperation();
$operation->operand = $adGroupCriterion;
$operation->operator = self::OPERATOR_SET;
$operations = array($operation);
// Make the mutate request.
$result = $adGroupCriterionService->mutate($operations);
$return[$key] = $result->value[0];
}
} catch (Exception $e) {
throw $e;
}
return $return;
}
среда, 23 ноября 2016 г., 18:22:23 UTC+3 пользователь Anthony Madrigal
написал:
>
> Hi,
>
> CpcBidSource and BiddingStrategySource are read-only fields so they will
> be ignored when using them. However, if you set the Cpc bids for keywords
> they should turn to CRITERION level, which is not happening like you said.
> Because of this, could you please provide me with the SOAP request and
> response for this API call and the adgroup Id and keyword Id that you are
> trying to set through *reply privately to author*?
>
> Thanks,
> Anthony
> AdWords API Team
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
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/2fae42ec-6d8e-4395-b312-23721ee99d39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.