AdServerGoogleTag

GoogleTag adapter for Google Ad Manager


Constructor

new AdServerGoogleTag(main)

Constructor of GoogleTag adapter

Parameters
Name Type Description
main Object

Instance of the main CpexPackage class

Methods

(async) call() @public

Mandatory. Calls the adserver to get the final ads selected and rendered


gamReRender(slotPath) @public

Wrapper for HB reRender to use GAM 'path' instead of elementId

Parameters
Name Type Description
slotPath string

GAM slot path


refresh(adUnitsopt) @public

Refreshes specific ad positions in GoogleTag

Parameters
Name Type Attributes Description
adUnits Array.<string> <optional>

Array of adUnit codes to refresh


adRenderDebug(event) @internal

Runs after rendering, waits a moment and then renders debug tags

Parameters
Name Type Description
event Object

GAM event object


addBid(elementId, slot) @internal

Adds winning bid to ad service to send it to ad server

Parameters
Name Type Description
elementId string

Element ID

slot Object

GAM slot object


(async) getAdUnitElementId(adUnit) → {Promise.<(string|null)>} @internal

Returns DOM element ID for given adUnit/hbKey

Parameters
Name Type Description
adUnit string

Ad unit name

Returns

Element ID or null

Type: 
Promise.<(string|null)>

(async) getAdsList() @internal

Mandatory. Returns (as a promise) an array of elementIds for the page, to be used for headerbidding


load() @internal

Mandatory. Initializes an adserver based on settings


logSlotTable() @internal

Logs table of all found ad server slots to console


prepareMetaData(elementId, event) @internal

Prepares object with useful information for debugging

Parameters
Name Type Description
elementId string

Element ID

event Object

GAM event object