This API defines operations to allow management of the spending limits in effect for inventory items within the Cxense Advertising platform.
Budgets specify spending limits for inventory elements below them.
The API can be accessed by users with the appropriate permissions to manage Budgets and supports the following combination of operations on Budget domain objects:
|
Object |
Supported operations |
|---|---|
|
BudgetList |
GET, POST |
|
Budget |
GET, PUT and DELETE |
Budget types
There are two broad classes of budgets based on how they are measured:
Counter Budgets
Counter budgets simply count the number of impression or click events that are tallied against the inventory. Counter budgets have 3 different types:
-
IMPRESSION_BALANCE: These are used on CPM style campaigns. If an advertiser buys 1,000,000 impressions for a CPM campaign, the limit is enforced by a counter budget, typically placed at the campaign folder. The budget's amount is set to 1,000,000 and its initial balance is set to 0. As impressions are recorded against ads in the campaign the balance is incremented. When the balance finally reaches the amount value (1,000,000) the campaign is disabled. These budgets cannot be set arbitrarily, they are created automatically upon creation of a CPM contract, see the Campaign and Contract REST API for details on setting up contracts. Hence, this REST API does not support creating/modifying or deleting these budgets. You can, however, retrieve them using a GET call.
-
IMPRESSION_CAP: These budgets enforce an absolute limit on the number of impressions allowed on the Campaign/Ad they are applied to during the period of the budget. Unlike IMPRESSION_BALANCE budgets they can apply on Ads/Campaigns using any product type, not just CPM and are user settable.
-
CLICK_CAP: Like IMPRESSION_CAP budgets except that they apply on clicks, i.e. once the number of clicks exceed the budget the Adserver will stop showing the Ad. Note that due to the fact that the Adserver has no direct control on clicks once an impression is made, there is a higher risk of encountering overage with these types of budgets.
-
Budget types
-
Counter Budgets
-
Currency Budgets
-
-
Operational Constraints
-
BudgetLists
-
GET
-
POST
-
-
Individual Budgets
-
GET
-
PUT
-
DELETE
-
Counter budgets have the following data fields (remember, you can only read IMPRESSION_BALANCE budgets, i.e. no creation/modification/deletion):
|
Field |
Meaning |
|---|---|
|
id |
the unique id of the Budget |
|
context |
the unique identifiers of the folder hierarchy of the budget |
|
amount |
a positive integer denoting the number of impressions (or clicks in the case of CLICK_CAPs) the budget enforces |
|
type |
the counter budget's type, one of IMPRESSION_BALANCE|IMPRESSION_CAP|CLICK_CAP (see explanation above) |
|
balance |
the number of impressions recorded to date against this budget, when it equals Amount, the Campaign/Ad is disabled |
|
startTime |
when the budget starts |
|
endTime |
this field only applies for IMPRESSION_BALANCE budgets and corresponds to when the CPM contract ends |
|
periodType |
one of DAILY|WEEKLY|MONTHLY|INDEFINITE |
|
folderId |
the Ad/Campaign id the budget applies to |
|
smoothed |
a boolean determining if the budget should be paced or consumed as soon as possible |
|
periodBalance |
a positive integer denoting the number of impressions (or clicks in the case of CLICK_CAPs) that have been served from this budget |
|
periodRemainingBalance |
a positive integer denoting the number of impressions (or clicks in the case of CLICK_CAPs) remaining to be served from this budget (amount - periodBalance) |
Currency Budgets
Currency budgets count against the monetary cost of events that occur against the inventory. These are typically used on CPC campaigns. Supposing an advertiser wishes to spend a maximum of USD 1,000.00 a day, accordingly he sets a daily currency budget of USD 10,000.00 against his campaign. The the budget's amount value is set to USD 1,000.00 while its initial balance is set to USD 0.00 and its period is set to DAILY. As clicks are recorded against ads in the campaign the balance is incremented by the cost of the clicks as determined by the CPC auction results. If the balance reaches USD 1,000.00 before the end of the day the campaign is disabled temporarily. It will be re-enabled on the next day with its balance reset to USD 0.00.
Unlike counter budgets, advertisers are free to create, modify and delete currency budgets.
Currency budgets have the following data fields (all fields mandatory unless otherwise indicated):
|
Field |
Meaning |
|---|---|
|
id |
the unique id of the Budget |
|
context |
the unique identifiers of the folder hierarchy of the budget |
|
amount |
a positive currency value denoting the maximum value the advertiser wishes to spend within the budget period |
|
type |
CURRENCY_CAP |
|
startTime |
when a budget starts |
|
periodType |
one of DAILY|WEEKLY|MONTHLY|INDEFINITE |
|
folderId |
the id of the folder the budget applies to |
|
smoothed |
a boolean determining if the budget should be paced or consumed as soon as possible |
|
periodStartTime |
the start date/time of the current budget period (not shown for Indefinite periods) |
|
periodEndTime |
the end date/time of the current budget period (not shown for Indefinite periods) |
|
peroidBalance |
a positive currency value denoting the value spend that have been served from this budget |
|
periodRemainingBalance |
a positive currency value denoting the value spend remaining to this budget (amount - periodBalance) |
|
periodProRata |
a boolean indicating if this period is a pro-rata period |
See Budgeting for further details.
Operational Constraints
-
You cannot create, modify or delete an IMPRESSION_BALANCE budget
-
You cannot create more than one budget of the same type on a single folder
-
Budgets can be modified but the only field you can modify is the amount, all the others are immutable once the budget is created. Of course, you can always delete a budget and create a new one if you make a mistake.
BudgetLists
Like most other cxad inventory types, Budgets are located under folders. If you have a folderId you can create a new Budget under it by POSTing to it and you can get the list of all Budgets under a folder (and its descendents) by GETting from it.
The GET operation is supported for listing existing Budgets.
GET
Retrieve the list of all Budgets created at any point under a folder.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
folderid the folder id under which to search for budgets
Example command:
|
Example result:
|
POST
Create a new currency Budget under the Folder with the given folderId. Remember, you cannot create a new IMPRESSION_BALANCE budget.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
folderId the id of the Folder under which the new Budget is to be created.
Example command:
|
This XML example shows the contents required to be POSTed when creating a currency Budget:
XML example:
|
The result of a successful POST will be the full xml content of the newly created budget.
Individual Budgets
The GET, PUT and DELETE operations are supported for management of individual Budgets.
GET
Retrieve the Budget with the given budgetId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
budgetId the id of the Budget to be retrieved
Example command:
|
XML example:
|
PUT
Update the Budget with the given budgetId. Note that only the amount value can be updated and IMPRESSION_BALANCE budgets cannot be updated.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
budgetId the id of the Budget to be retrieved
-
amount a positive decimal value for the new amount
Example command:
|
DELETE
Delete the Budget with the given budgetId. Remember IMPRESSION_BALANCE budgets cannot be deleted.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
budgetId the id of the Budget to be retrieved
Example command:
|