Posts tagged with adwords-budgetservice

Does anybody have some sample code that shows how to get the daily, total billed cost (across all campaigns) of a google ads account?

I have been looking for a sample for a while but could not find where you can get the total cost/billed cost for the day (or for a certain period of time).

I am doing this in Js but a sample in any language is okay. I would like to send this data to an airtable base, so if you have any suggestions on how that can be done too, that would be great!

Thanks in advance!

I already have a campaign budget which i want to update using google AdWords API.

   BudgetServiceInterface budgetService =         adWordsServices.get(session, BudgetServiceInterface.class);     // Create a budget, which can be shared by multiple campaigns.     Budget sharedBudget = new Budget();     sharedBudget.setName("Interplanetary Cruise #" + System.currentTimeMillis());     Money budgetAmount = new Money();     budgetAmount.setMicroAmount(50_000_000L);     sharedBudget.setAmount(budgetAmount);     sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);     BudgetOperation budgetOperation = new BudgetOperation();     budgetOperation.setOperand(sharedBudget);     budgetOperation.setOperator(Operator.ADD);     // Add the budget     Long budgetId =         budgetService.mutate(new BudgetOperation[] {budgetOperation}).getValue(0).getBudgetId();     // Get the CampaignService.     CampaignServiceInterface campaignService =         adWordsServices.get(session, CampaignServiceInterface.class); 

Assiging budgetId to campaign

    Budget budget = new Budget();     budget.setBudgetId(budgetId);     campaign.setBudget(budget); 

This will unassign existing campaign budget and assign new campaign budget to the campaign ( campaign budget is not removed and it still exist in google ads) but I want to update the budget name and budget amount of existing campaign budget rather than assigning new campaign budget.