RE: budget issue in creation new campaign.

2021-11-15 Thread 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
Hi everyone,

Thank you Jindong for your input regarding the explicitly_shared attribute.

@Oleg, you can also check here, for more information on how to set a campaign 
budget only for a single campaign. If you continue to encounter issues, you may 
provide our team with the complete request and response logs, along with the 
request-id.

You may then send the requested information via the Reply privately to author 
option. If this option is not available, you may send the details directly to 
our googleadsapi-supp...@google.com alias instead.

Best regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 
Google Ads API and AdWords API Annual Survey

Peter Laurence Napa Oliquino
Google Ads API Team
ref:_00D1U1174p._5004Q2R92yB:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/WIKNr0R2LWHD009tgK2RAETPKmS2f1YJVgdw%40sfdc.net.


Re: budget issue in creation new campaign.

2021-11-15 Thread jindong o
Yes, Sample code use shared budget.
you can use non-shared budget like this...
$budget = new CampaignBudget([
'name' => 'non shared budget#' . Helper::getPrintableDatetime(),
'delivery_method' => BudgetDeliveryMethod::STANDARD,
'amount_micros' => $campaign_budget,
   * 'explicitly_shared' => false*
]);


On Monday, November 15, 2021 at 4:13:41 PM UTC+8 jindong o wrote:

> you should use budget resource.
> and you can check Campaign resource class.
> It is important to look at the class definition and variable types and 
> names while using the google ads api.
> this is my past working code snippet. 
> $budgetResourceName = self::addCampaignBudget($googleAdsClient, 
> $cam_infos['customer_id'], $cam_infos['campaign_budget']);
> .
> $campaign = new Campaign([
> 'name' => $cam_infos['campaign_name'],
> 'advertising_channel_type' => 
> $cam_infos['advertising_channel_type'],  
> 'status' => $cam_infos['status'],
> 'manual_cpc' => new 
> ManualCpc(['enhanced_cpc_enabled'=>true]),
> 
> 'bidding_strategy_type'=>$cam_infos['bidding_strategy_type'],
> 'tracking_url_template'=>$cam_infos['tracking_template'],
> 'campaign_budget' => $budgetResourceName,
> 'network_settings' => $networkSettings,
> 'start_date' => $cam_infos['start_date'],
> //'end_date' => $cam_infos['end_date']
> ]);
> ..
> private static function addCampaignBudget(GoogleAdsClient 
> $googleAdsClient, int $customerId,int $campaign_budget){
> // Creates a campaign budget.
> $budget = new CampaignBudget([
> 'name' => 'non shared budget#' . 
> Helper::getPrintableDatetime(),
> 'delivery_method' => BudgetDeliveryMethod::STANDARD,
> 'amount_micros' => $campaign_budget,
> 'explicitly_shared' => false // this is for non-shared budget
> ]);
>
> // Creates a campaign budget operation.
> $campaignBudgetOperation = new CampaignBudgetOperation();
> $campaignBudgetOperation->setCreate($budget);
>
> // Issues a mutate request.
> $campaignBudgetServiceClient = 
> $googleAdsClient->getCampaignBudgetServiceClient();
> $response = $campaignBudgetServiceClient->mutateCampaignBudgets(
> $customerId,
> [$campaignBudgetOperation]
> );
>
> /** @var CampaignBudget $addedBudget */
> $addedBudget = $response->getResults()[0];
> //printf("Added budget named '%s'%s", 
> $addedBudget->getResourceName(), PHP_EOL);
>
> return $addedBudget->getResourceName();
> }
> On Monday, November 15, 2021 at 3:18:19 PM UTC+8 ol...@disrupt.social 
> wrote:
>
>> Hello
>> when i try to run this script,  I can see new budget(shared budget) with 
>> new campaign.
>> php examples/BasicOperations/AddCampaigns.php --customerId 9641267633
>> I only want to create new campaign with individual campaign budget (only 
>> budget number) not user addCampaignBudget 
>> for example
>> $campaign = new Campaign([
>> 'name' => 'campaign1',
>> 
>> 'campaign_budget' => 10,
>> ...
>> ]);
>>
>> How can i do that?
>> Thanks
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b450a35c-8c32-450c-98bc-b67ceb4c78e6n%40googlegroups.com.


Re: budget issue in creation new campaign.

2021-11-15 Thread jindong o
you should use budget resource.
and you can check Campaign resource class.
It is important to look at the class definition and variable types and 
names while using the google ads api.
this is my past working code snippet. 
$budgetResourceName = self::addCampaignBudget($googleAdsClient, 
$cam_infos['customer_id'], $cam_infos['campaign_budget']);
.
$campaign = new Campaign([
'name' => $cam_infos['campaign_name'],
'advertising_channel_type' => 
$cam_infos['advertising_channel_type'],  
'status' => $cam_infos['status'],
'manual_cpc' => new 
ManualCpc(['enhanced_cpc_enabled'=>true]),

'bidding_strategy_type'=>$cam_infos['bidding_strategy_type'],
'tracking_url_template'=>$cam_infos['tracking_template'],
'campaign_budget' => $budgetResourceName,
'network_settings' => $networkSettings,
'start_date' => $cam_infos['start_date'],
//'end_date' => $cam_infos['end_date']
]);
..
private static function addCampaignBudget(GoogleAdsClient $googleAdsClient, 
int $customerId,int $campaign_budget){
// Creates a campaign budget.
$budget = new CampaignBudget([
'name' => 'non shared budget#' . Helper::getPrintableDatetime(),
'delivery_method' => BudgetDeliveryMethod::STANDARD,
'amount_micros' => $campaign_budget,
'explicitly_shared' => false // this is for non-shared budget
]);

// Creates a campaign budget operation.
$campaignBudgetOperation = new CampaignBudgetOperation();
$campaignBudgetOperation->setCreate($budget);

// Issues a mutate request.
$campaignBudgetServiceClient = 
$googleAdsClient->getCampaignBudgetServiceClient();
$response = $campaignBudgetServiceClient->mutateCampaignBudgets(
$customerId,
[$campaignBudgetOperation]
);

/** @var CampaignBudget $addedBudget */
$addedBudget = $response->getResults()[0];
//printf("Added budget named '%s'%s", 
$addedBudget->getResourceName(), PHP_EOL);

return $addedBudget->getResourceName();
}
On Monday, November 15, 2021 at 3:18:19 PM UTC+8 ol...@disrupt.social wrote:

> Hello
> when i try to run this script,  I can see new budget(shared budget) with 
> new campaign.
> php examples/BasicOperations/AddCampaigns.php --customerId 9641267633
> I only want to create new campaign with individual campaign budget (only 
> budget number) not user addCampaignBudget 
> for example
> $campaign = new Campaign([
> 'name' => 'campaign1',
> 
> 'campaign_budget' => 10,
> ...
> ]);
>
> How can i do that?
> Thanks
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/421a9eea-1408-4f3b-b6d3-71b6bc804442n%40googlegroups.com.


RE: budget issue in creation new campaign.

2021-11-15 Thread 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
Hi Oleg,

Thank you for posting your concern.

You may try to remove the implementation for creating a budget, then you may 
insert a report for campaign_budget to get the resource name of the campaign 
budget. After retrieving the resource name, then set it to the campaign_budget 
field of the Campaign resource.

Let me know if you have questions with the provided suggestion.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 
Google Ads API and AdWords API Annual Survey

Ernie John Blanca Tacata
Google Ads API Team
ref:_00D1U1174p._5004Q2R92yB:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/JJKc_0R2LTEV00OzKzpRZlQvucfkUJ5WlFUg%40sfdc.net.


budget issue in creation new campaign.

2021-11-14 Thread Oleg Disrupt
Hello
when i try to run this script,  I can see new budget(shared budget) with 
new campaign.
php examples/BasicOperations/AddCampaigns.php --customerId 9641267633
I only want to create new campaign with individual campaign budget (only 
budget number) not user addCampaignBudget 
for example
$campaign = new Campaign([
'name' => 'campaign1',

'campaign_budget' => 10,
...
]);

How can i do that?
Thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/daf52f9a-ca87-4aa5-ac4d-a877ba3b5facn%40googlegroups.com.