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?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/5394ced8-b298-415a-86d3-04a75e2bc821%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • upda... Wizard Meccup
    • ... 'Anthony Madrigal' via AdWords API Forum
      • ... Wizard Meccup
        • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum

Reply via email to