Hi Mike,

The problem I'm facing is when I try to add my campaign without specifying  
the biddingStrategyType, and with a daily budget, I got an error saying 
*Missing 
required field*, which is the  biddingStrategyType. 
Cause according to your last blog post, I should not use the bidding 
strategy type target spend in the future, if I want to maximize the clicks.
You can find bellow how I'm creating my campaign. Please correct me if 
there is any confusion.

*_Ad.AdSet.is_autobid*  = false; 

        private List<Google.Api.Ads.AdWords.v201809.CampaignOperation> 
BuildCampaignOperations(SM.Data.Models.AdModel.Ad 
<http://sm.data.models.admodel.ad/> _Ad, string camapignId, long budgetId, 
string action)
        {
            List<Google.Api.Ads.AdWords.v201809.CampaignOperation> 
operations = new List<Google.Api.Ads.AdWords.v201809.CampaignOperation>();
            Google.Api.Ads.AdWords.v201809.Campaign campaign = new 
Google.Api.Ads.AdWords.v201809.Campaign()
            {
                id = string.IsNullOrEmpty(camapignId) ? NextId() : 
long.Parse(camapignId),
                budget = new Budget()
                {
                    budgetId = budgetId
                }
            };

            if (action == "ADD")
            {
                campaign.name = _Ad.Name;
                campaign.status = CampaignStatus.PAUSED;
            }

            BiddingStrategyConfiguration biddingStrategyConfiguration = new 
BiddingStrategyConfiguration();

            if (*_Ad.AdSet.is_autobid* == false)
            {
                if (_Ad.AdSet.billing_event == "IMPRESSIONS")
                {
                    biddingStrategyConfiguration.biddingStrategyType = 
BiddingStrategyType.MANUAL_CPM;
                }
                else if (_Ad.AdSet.billing_event == "LINK_CLICKS")
                {
                    biddingStrategyConfiguration.biddingStrategyType = 
BiddingStrategyType.MANUAL_CPC;
                }
            }

            campaign.biddingStrategyConfiguration = 
biddingStrategyConfiguration;

            // Campaign Channel Type
            if (_Ad.AdSet.AdCampaign.objective == "SEARCH")
                campaign.advertisingChannelType = 
AdvertisingChannelType.SEARCH;
            else if (_Ad.AdSet.AdCampaign.objective == "DISPLAY")
                campaign.advertisingChannelType = AdvertisingChannelType.
DISPLAY;
           
            // Set the network settings
            NetworkSetting networkSetting = new NetworkSetting();
            foreach (AdPlatform _AdPPlatform in _Ad.AdSet.AdPlatforms)
            {
                if (_AdPPlatform.Platform == "SEARCH")
                {
                    networkSetting.targetGoogleSearch = true;
                    networkSetting.targetSearchNetwork = true;
                }
                if (_AdPPlatform.Platform == "CONTENT")
                    networkSetting.targetContentNetwork = true;
            }
            campaign.networkSetting = networkSetting;

            // Set start and end date
            if(action == "ADD")
                campaign.startDate = ((_Ad.AdSet.start_time ?? 
DateTime.Now) > DateTime.Now ? (_Ad.AdSet.start_time ?? DateTime.Now) : 
DateTime.Now).ToString("yyyyMMdd");
            campaign.endDate = (_Ad.AdSet.end_time ?? 
DateTime.Now).ToString("yyyyMMdd");

            Google.Api.Ads.AdWords.v201809.CampaignOperation operation = 
new Google.Api.Ads.AdWords.v201809.CampaignOperation()
            {
                operand = campaign,
                @operator = action == "ADD" ? Operator.ADD : Operator.SET
            };
            operations.Add(operation);

            return operations;
        }

Thanks,
Zied

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/037b76b0-3312-4b9c-a6e4-e26105831528%40googlegroups.com.

Reply via email to