Home Reference Source
import AdServerGoogleTag from 'cpex-package/src/adserver/googletag.js'
public class | source

AdServerGoogleTag

This adapter replaces AdServer object instance registered in the main package instance Doesn't support catching of custom formats from S2S, since refresh directly renders the ad without any possible step in-between

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public

loading: *

public

main: *

public
public

slots: *[]

public

Method Summary

Public Methods
public

adRenderDebug(event: *)

Triggered after the render, it waits a moment for the ad to be rendered, then draws debug tags over it

public

addBid(elementId: *, slot: *)

Add winning bid to the ad service, so it sends it to the ad server

public

async call()

Mandatory.

public

gamReRender(slotPath: *)

Wraps HB reRender to be usable with ad manager`s "path" instead of elementId.

public

async getAdsList(): *[]

Mandatory.

public

async getElementId(hbKey: *): *

Mandatory.

public

load(): *

Mandatory.

public

Prints table of all found adserver slots into the console

public

prepareMetaData(elementId: *, event: *)

Prepares an object with useful information for debubbing.

public

refresh(adUnits: *)

Refresh specific to googletag, able to refresh only certain ad positions.

Public Constructors

public constructor() source

Public Members

public adapter: string source

public dependenciesLoading: boolean source

public displayed: boolean source

public eventHandler: * source

public loading: * source

public main: * source

public pubAdsReady: * source

public slots: *[] source

public slotsDefined: * source

Public Methods

public adRenderDebug(event: *) source

Triggered after the render, it waits a moment for the ad to be rendered, then draws debug tags over it

Params:

NameTypeAttributeDescription
event *

public addBid(elementId: *, slot: *) source

Add winning bid to the ad service, so it sends it to the ad server

Params:

NameTypeAttributeDescription
elementId *
slot *

public async call() source

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

public gamReRender(slotPath: *) source

Wraps HB reRender to be usable with ad manager`s "path" instead of elementId. Triggered from HB service creative in GAM

Params:

NameTypeAttributeDescription
slotPath *

public async getAdsList(): *[] source

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

Return:

*[]

public async getElementId(hbKey: *): * source

Mandatory. Returns DOM element id for the adUnit/hbKey

Params:

NameTypeAttributeDescription
hbKey *

Return:

*

public load(): * source

Mandatory. Initializes an adserver based on settings

Return:

*

public logSlotTable() source

Prints table of all found adserver slots into the console

public prepareMetaData(elementId: *, event: *) source

Prepares an object with useful information for debubbing. Merges info from both adserver and prebid. 2DO: Currently relies on the SAS flight for HB having the string "HB" in it's first comment. Should be improved.

Params:

NameTypeAttributeDescription
elementId *
event *

public refresh(adUnits: *) source

Refresh specific to googletag, able to refresh only certain ad positions. adUnits - optional array of adUnit codes

Params:

NameTypeAttributeDescription
adUnits *