Hi,
I try to set(update) keyword's bidding with BatchJobService on PHP.
I create several operation:
foreach ($keywordsData as $keywordData) {
// Create ad group criterion.
$adGroupCriterion = new BiddableAdGroupCriterion();
$adGroupCriterion->adGroupId = $keywordData['adGroupId'];
$adGroupCriterion->criterion = new Criterion($keywordData['id'], 'KEYWORD');
// Set bids (optional).
$bid = new CpcBid();
$bid->bid = new Money($keywordData['bid'] * self::MICRO_AMOUNT);
$bid->cpcBidSource = 'CRITERION';
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->biddingStrategyType = 'MANUAL_CPC';
$biddingStrategyConfiguration->biddingStrategySource = 'CRITERION';
$cpcBiddingScheme = new ManualCpcBiddingScheme();
$cpcBiddingScheme->enhancedCpcEnabled = false;
$biddingStrategyConfiguration->biddingScheme = $cpcBiddingScheme;
$biddingStrategyConfiguration->bids[] = $bid;
$adGroupCriterion->biddingStrategyConfiguration = $biddingStrategyConfiguration;
// Create operation.
$operation = new AdGroupCriterionOperation();
$operation->operand = $adGroupCriterion;
$operation->operator = 'SET';
$operations[] = $operation;
}
There is one of operation:
[4] => AdGroupCriterionOperation Object
(
[operand] => BiddableAdGroupCriterion Object
(
[userStatus] =>
[systemServingStatus] =>
[approvalStatus] =>
[disapprovalReasons] =>
[destinationUrl] =>
[experimentData] =>
[firstPageCpc] =>
[topOfPageCpc] =>
[firstPositionCpc] =>
[qualityInfo] =>
[biddingStrategyConfiguration] => BiddingStrategyConfiguration Object
(
[biddingStrategyId] =>
[biddingStrategyName] =>
[biddingStrategyType] => MANUAL_CPC
[biddingStrategySource] => CRITERION
[biddingScheme] => ManualCpcBiddingScheme Object
(
[enhancedCpcEnabled] =>
[BiddingSchemeType] =>
[_parameterMap:BiddingScheme:private] => Array
(
[BiddingScheme.Type] => BiddingSchemeType
)
)
[bids] => Array
(
[0] => CpcBid Object
(
[bid] => Money Object
(
[microAmount] => 51300000
[ComparableValueType] =>
[_parameterMap:ComparableValue:private] => Array
(
[ComparableValue.Type] => ComparableValueType
)
)
[cpcBidSource] => CRITERION
[BidsType] =>
[_parameterMap:Bids:private] => Array
(
[Bids.Type] => BidsType
)
)
)
)
[bidModifier] =>
[finalUrls] =>
[finalMobileUrls] =>
[finalAppUrls] =>
[trackingUrlTemplate] =>
[urlCustomParameters] =>
[adGroupId] => 8427124XXX
[criterionUse] =>
[criterion] => Criterion Object
(
[id] => 41399813XXX
[type] => KEYWORD
[CriterionType] =>
[_parameterMap:Criterion:private] => Array
(
[Criterion.Type] => CriterionType
)
)
[labels] =>
[forwardCompatibilityMap] =>
[baseCampaignId] =>
[baseAdGroupId] =>
[AdGroupCriterionType] =>
[_parameterMap:AdGroupCriterion:private] => Array
(
[AdGroupCriterion.Type] => AdGroupCriterionType
)
)
[exemptionRequests] =>
[operator] => SET
[OperationType] =>
[_parameterMap:Operation:private] => Array
(
[Operation.Type] => OperationType
)
)
Then i try to upload it:
$batchJobUtils = new BatchJobUtils($uploadUrl);
$batchJobUtils->UploadBatchJobOperations($operations);
There is an uploading result as XML object:
[result] => SimpleXMLElement Object
(
[AdGroupCriterion] => SimpleXMLElement Object
(
[adGroupId] => 8427124XXX
[criterion] => SimpleXMLElement Object
(
[id] => 41399813XXX
[type] => KEYWORD
[Criterion.Type] => Keyword
[text] => XXXXXXXXXX XXXXXXXX XX
[matchType] => PHRASE
)
[AdGroupCriterion.Type] => BiddableAdGroupCriterion
[userStatus] => ENABLED
[systemServingStatus] => ELIGIBLE
[approvalStatus] => APPROVED
[biddingStrategyConfiguration] => SimpleXMLElement Object
(
[biddingStrategyType] => MANUAL_CPC
[biddingStrategySource] => CRITERION
[biddingScheme] => SimpleXMLElement Object
(
[BiddingScheme.Type] => ManualCpcBiddingScheme
[enhancedCpcEnabled] => false
)
[bids] => Array
(
[0] => SimpleXMLElement Object
(
[Bids.Type] => CpmBid
[bid] => SimpleXMLElement Object
(
[ComparableValue.Type] => Money
[microAmount] => 7000000
)
[cpmBidSource] => ADGROUP
)
[1] => SimpleXMLElement Object
(
[Bids.Type] => CpcBid
[bid] => SimpleXMLElement Object
(
[ComparableValue.Type] => Money
[microAmount] => 100000000
)
[cpcBidSource] => ADGROUP
)
)
)
)
)
)
But bids are not setted from operation bid. And cpcBidSource equal to "ADGROUP", but must be equal to "CRITERION".
Campaing has type "Only Search Network".
Why i can't set the bid to keywords?
What wrong with my code?