Hello.

I am trying to create a campaign with these settings for the bidding 
strategy:
Focus on *clicks* - use maximum CPC bids
AdWords will set my bids to help maximize clicks within my target budget

In the example, I only see MANUAL_CPC. I tried with BUDGET_OPTIMIZER, but I 
get this error:

CANNOT_ATTACH_BIDDING_STRATEGY_TO_CAMPAIGN

Here is my code:

// Get the campaign service
$campaignService = $user->GetService('CampaignService', 
self::ADWORDS_VERSION);

// Create the campaign object.
$campaign = new Campaign();
$campaign->name = $data['name'];

// Link to the previously created budget.
$campaign->budget = new Budget();
$campaign->budget->budgetId = $budget->budgetId;

// Set bidding strategy.
$campaign->biddingStrategyConfiguration = new 
BiddingStrategyConfiguration();
$campaign->biddingStrategyConfiguration->biddingStrategyType = 
'BUDGET_OPTIMIZER';

// Optimize the serving of the ad
$campaign->adServingOptimizationStatus = 'OPTIMIZE';

// Set keyword matching setting.
$keywordMatchSetting = new KeywordMatchSetting();
$keywordMatchSetting->optIn = TRUE;
$campaign->settings[] = $keywordMatchSetting;

// Set the channel type
$campaign->advertisingChannelType = 'DISPLAY';

// Call the service.
$result = $campaignService->mutate(array(
new CampaignOperation($campaign, 'ADD')
));

// Return the campaign.
return $result->value[0];

Do you have any help to offer ?
Thank you very much.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to