Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

AdEngine supports additional ad units in the page, externally created through the googletag object in GPT. These can be Ad Manager only units, a special campaign, etc., that are not directly set in AdEngine, but can be managed by AdEngine in on pair with the other units.
To add these units to AdEngine, the adngin.cmd.setGoogletagAdSlots() API function needs to be called as a part of AdEngine's functional configuration. Alternatively, it can be added using declarative configuration.

Syntax

function adngin.cmd.setGoogletagAdSlots(parameter, callback)

argument name

type

optional

value

description

parameter

Array<googletag.Slot>

Array holding the the googletag ad unit slots created through the function googletag.defineSlot().

callback

function

✔️

function(result:CallbackResult, success:boolean)

The callback function that is called with the function call result.

...

This function uses the GPT slot objects directly, which implies that access to the created slots data is needed, which may not be the case at all times. Using setGoogletagAdSlotElementIds instead is recommended, as it decouples GPT structures from AdEngine by using the GPT div element id, which makes the page code simpler and improves performance by removing dependencies.

...

The function can be called after AdEngine loader is ready and the AdEngine queue is defined, see functional configuration for more details.

Example

Adding the googletag ad unit slots "outstream" and "sidebar" to AdEngine using the command queue and event system

...