Constructor
new AdServerGoogleTag(main)
Constructor of GoogleTag adapter
| Name | Type | Description |
|---|---|---|
main |
Object | Instance of the main CpexPackage class |
Methods
(async) call()
Mandatory. Calls the adserver to get the final ads selected and rendered
gamReRender(slotPath)
Wrapper for HB reRender to use GAM 'path' instead of elementId
| Name | Type | Description |
|---|---|---|
slotPath |
string | GAM slot path |
refresh(adUnitsopt)
Refreshes specific ad positions in GoogleTag
| Name | Type | Attributes | Description |
|---|---|---|---|
adUnits |
Array. |
<optional> | Array of adUnit codes to refresh |
adRenderDebug(event)
Runs after rendering, waits a moment and then renders debug tags
| Name | Type | Description |
|---|---|---|
event |
Object | GAM event object |
addBid(elementId, slot)
Adds winning bid to ad service to send it to ad server
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
slot |
Object | GAM slot object |
(async) getAdUnitElementId(adUnit) → {Promise.<(string|null)>}
Returns DOM element ID for given adUnit/hbKey
| Name | Type | Description |
|---|---|---|
adUnit |
string | Ad unit name |
Element ID or null
- Type:
-
Promise.
<(string| null)>
(async) getAdsList()
Mandatory. Returns (as a promise) an array of elementIds for the page, to be used for headerbidding
load()
Mandatory. Initializes an adserver based on settings
logSlotTable()
Logs table of all found ad server slots to console
prepareMetaData(elementId, event)
Prepares object with useful information for debugging
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
event |
Object | GAM event object |