Hi
I want to create a campaign with only lifetime budget rather than daily
budget with campaing type: search and display. I was trying to assign value
in "total_amount_micros" instead to "amount_micros', now the budget is
create but not able to associated with the budget.
Error return in the api is:
Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"operationAccessDeniedError":
"OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE"},"message":"This operation is
not permitted on this campaign type","trigger":{"stringValue":"SEARCH"},
"location":{"fieldPathElements":[{"fieldName":"operations","index":0},{
"fieldName":"create"},{"fieldName":"campaign_budget"}]}}],"requestId":
"Mx-flA2GgG6vhM1Jg6vBxw"}
*Code of CampaignBudget*
// Creates a campaign budget.
$totalBudgetAmountMicros = 200000000; // 100 rupees in micros.
$budget = new CampaignBudget([
'name' => 'Interplanetary Cruise Budget #' . Helper::getPrintableDatetime(),
'delivery_method' => BudgetDeliveryMethod::STANDARD,
'period' => \Google\Ads\GoogleAds\V12\Enums\BudgetPeriodEnum\BudgetPeriod
::CUSTOM_PERIOD,
//'amount_micros' => 500000,
'total_amount_micros' => $totalBudgetAmountMicros,
'explicitly_shared' => false,
]);
*Code of Campaign*
$campaign = new Campaign([
'name' => 'Testing Seema #' . Helper::getPrintableDatetime(),
'advertising_channel_type' => AdvertisingChannelType::SEARCH,
// Recommendation: Set the campaign to PAUSED when creating it to prevent
// the ads from immediately serving. Set to ENABLED once you've added
// targeting and the ads are ready to serve.
'status' => CampaignStatus::PAUSED,
// Sets the bidding strategy and budget.
'manual_cpc' => new ManualCpc(),
'campaign_budget' => $budgetResourceName,
// 'target_cpa' => new TargetCpa(['target_cpa_micros' => 1000000]),
// 'bidding_strategy' => $addedBiddingStrategy,
// 'bidding_strategy' => new CampaignBiddingStrategy([
// 'type' => BiddingStrategyType::TARGET_CPA,
// 'bidding_scheme' => new TargetCpa([
// 'target_cpa_micros' => 5000000, // 5.00
// 'bid_ceiling_micros' => 7000000, // 7.00
// 'bid_floor_micros' => 3000000, // 3.00
// ]),
// ]),
// 'target_cpa' => new TargetCpa([
// 'target_cpa_micros' => 5000000
// ]),
// Adds the network settings configured above.
// 'network_settings' => $networkSettings,
// Optional: Sets the start and end dates.
'start_date' => date('Ymd', strtotime('+1 day')),
'end_date' => date('Ymd', strtotime('+1 month'))
]);
I am not able to understand what I need to change to fix that issue. Budget
is created successfully but still campaign is not able to create if I use
choose daily budget "amount_micros" instead to "total_amount_micros', then
working fine but our purpose is to create a campaign with lifetime budget.
*Urgent need help*
Thanks and regards
On Wednesday, 5 April 2023 at 18:17:55 UTC+5:30 Google Ads API Forum
Advisor wrote:
> Hi,
>
> Thank you for reaching out to Google Ads API Forum.
>
> Kindly provide us more context on your concern and what you mean by
> lifetime budget approach in *Google Ads API*
> <https://developers.google.com/google-ads/api/docs/start> in v12 version?
> This is so we can provide more accurate answers accordingly.
>
> Additionally, if you are encountering errors in the *Google Ads API*
> <https://developers.google.com/google-ads/api/docs/start> on your end, in
> order for us to further check the cause of your error, kindly provide us
> with the complete *request*
> <https://developers.google.com/google-ads/api/docs/concepts/field-service?hl=en#request>
> and *response*
> <https://developers.google.com/google-ads/api/docs/concepts/field-service?hl=en#response>
> logs
> with the *request-id*
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure?hl=en#request-id>
> generated
> on your end when you encountered the issue, so that our team can take a
> closer look. We can check within these logs the data you sent to API and
> its corresponding API response if there are any issues. You may provide it
> via the Reply privately to author option. If this option is not available,
> then send it instead on this email address [email protected]
> <https://groups.google.com/>.
>
> Regards,
> [image: Google Logo] Google Ads API Team
>
> ref:_00D1U1174p._5004Q2kFXSI: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 [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
"Google Ads API and AdWords 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/d2c7e3a1-8ae7-44b1-aabd-8c63daf02f1cn%40googlegroups.com.