Need to create a camapign for lifetime

98 views
Skip to first unread message

Socially Recruited

unread,
Apr 5, 2023, 5:52:19 AM4/5/23
to Google Ads API and AdWords API Forum
Hi,

Can anyone help on lifetime budget approach in google ads api in v12 version

Thanks and regards

Google Ads API Forum Advisor

unread,
Apr 5, 2023, 8:47:55 AM4/5/23
to socical...@gmail.com, adwor...@googlegroups.com

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 in v12 version? This is so we can provide more accurate answers accordingly.

Additionally, if you are encountering errors in the Google Ads API on your end, in order for us to further check the cause of your error, kindly provide us with the complete request and response logs with the 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 googleadsa...@google.com.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kFXSI:ref

Socially Recruited

unread,
Apr 5, 2023, 9:09:45 AM4/5/23
to Google Ads API and AdWords API Forum
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

Google Ads API Forum Advisor

unread,
Apr 5, 2023, 2:21:15 PM4/5/23
to socical...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back with us.

I see that you are getting OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE, this means that this operation is not permitted on this campaign type that you are using. 

With regards to the error you are getting, can you provide us with the campaign type you are using? Can you also provide the complete request and response logs with request ID generated as shown in the respective links?  

In line with this, as the API mirrors the Google Ads UI. Meaning, the Google Ads API should be able to pull or create the data that the Google Ads UI is showing. With this, can you also share the uncropped screenshot (if possible) of the data you want to create from Google Ads UI into Google Ads API?  

We do this to further check the error thrown on your side and provide appropriate recommendations. 

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 googleadsa...@google.com alias instead.

Links included in this email:

Reply all
Reply to author
Forward
0 new messages