Muokkaa

Jaa


Budget

Contains the methods for managing a budget. For more information, see Budget.

Methods

Method Name Return Type Description
campaigns CampaignSelector Gets a selector used to filter the list of campaigns that share this budget.
getAmount double Gets the budget's amount.
getDeliveryMethod string Gets the delivery method (budget type) for this budget.
getEntityType string Gets this entity's type.
getId string Gets the ID that uniquely identifies this shared budget.
getName string Gets this shared budget's name.
getStats Stats Gets the performance data for the campaigns that share this budget.
getType string Gets this budget's type.
isExplicitlyShared Boolean Gets a Boolean value that indicates whether this budget is a shared budget.
setAmount(double amount) void Sets the budget to the specified amount.
setDeliveryMethod(String method) void Sets the delivery method for this budget.

campaigns

Gets a selector used to filter the list of campaigns that share this budget.

Call this method only from a budget object retrieved using BudgetSelector; you may not call it if you retrieved the budget using the campaign's getBudget method.

Returns

Type Description
CampaignSelector A selector used to filter the list of campaigns that share this budget.

getAmount

Gets the budget's amount.

Returns

Type Description
double The budget, in the account's currency.

getDeliveryMethod

Gets the budget's delivery method (budget type).

Returns

Type Description
string The budget's delivery method. Possible values are:
  • STANDARD
  • ACCELERATED
For more information, see What are my budget options?

getEntityType

Gets this entity's type.

Returns

Type Description
string This entity's type, which is Budget.

getId

Gets the ID that uniquely identifies this shared budget.

Returns

Type Description
string The ID that uniquely identifies this shared budget. Returns null if the budget is not a shared budget.

getName

Gets this shared budget's name.

Returns:

Type Description
string The shared budget's name. Returns null if the budget is not a shared budget.

getType

Gets this budget's type.

Returns:

Type Description
string The budget's type. The following are the possible types.
  • DAILY

getStats

Gets the performance data for for campaigns that share this budget.

Performance data is available for shared budgets only. To call this method, you must include the forDateRange(String dateRange) or forDateRange(Object dateFrom, Object dateTo) method in the budget selector's chain.

Returns:

Type Description
Stats The performance data for campaigns that share this budget. Returns null if the budget is not a shared budget.

isExplicitlyShared

Gets a Boolean value that indicates whether this budget is a shared budget.

The campaigns and the budget they share must be in the same account. Sharing a budget can help fully utilize the budget. For example, if campaign A had its own $10 budget and campaign B had its own $10 budget, it's possible that campaign A may spend only $8 of its budget. But because campaign B is performing well, it spent all of its budget and could have spent more. If the campaigns shared a budget, campaign B would automatically use the $2 that campaign A didn't use, increasing the chance that more traffic is sent your way.

Returns:

Type Description
Boolean Is true if the budget is meant to be shared by multiple campaigns; otherwise, false.

setAmount(double amount)

Sets the budget's amount.

To update a shared budget, you must get the budget using BudgetSelector and BudgetIterator. Setting the budget's amount fails if you get the budget using the Campaign entity's getBudget method.

Arguments

Name Type Description
amount double The budget, in the account's currency.

Returns

Type Description
void Returns nothing.

setDeliveryMethod(string method)

Sets the budget's delivery method.

Arguments

Name Type Description
method string The budget's delivery method. Possible case-sensitive values are:
  • STANDARD
  • ACCELERATED
For more information, see What are my budget options?

Returns

Type Description
void Returns nothing.

See also

Campaign.getBudget() BudgetIterator.next()