Table of Contents |
---|
Functionality
The function adngin.cmd.getAvailableAdUnitNames()
returns a list of available ad-unit names configured in AdEngine for the site. It is usually used in the browser console to find out which ad-unit are available to declare active ad-units or pass to startAuction().
Syntax
function adngin.cmd.getAvailableAdUnitNames(parameter, callback)
...
Code Block |
---|
CallbackResult = {
message: "<string holding a debug log of the function call result>",
data: <Array holding all the ad unit names for this publisher>
}COPY |
The callback function will receive the above object as the first parameter and a boolean value translating the function call success status as the second parameter.
...
After calling the function, AdEngine will provide a list with the names of all configured ad units for the current site under the data
field of the JSON object that is passed as the first argument of the provided callback function.
...
The function can be called at any time during AdEngine execution.
Example
Getting AdEngine current available ad units and logging them in the browser console
Code Block |
---|
adngin.cmd.getAvailableAdUnitNames(null, function(result, success) { if (success) { console.log(result.data); } else { // failed, check what has failed console.log(result.message); } }); |
...