PublisherMafra

Publisher-specific class for Mafra


Constructor

new PublisherMafra(main)

Constructor of PublisherMafra class

Parameters
Name Type Description
main Object

Instance of the main CpexPackage class

Methods

reRender(elementId, adUnitopt) @public

Wraps HB reRender to add metadata

Parameters
Name Type Attributes Description
elementId string

Element ID

adUnit string <optional>

Ad unit name


(async) refresh(adUnitsopt) → {Promise.<boolean>} @public

Refreshes specific ad positions for Mafra

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

Array of adUnit codes to refresh

Returns

True if successful

Type: 
Promise.<boolean>

createSlideup(winningBid) @internal

Creates a slideup format using the Mafra's Ads library, with the winning bid rendered inside. Supports both native and iframe ads.

Parameters
Name Type Description
winningBid Object

The winning bid object returned from the auction, containing information such as adUnitCode, adId, width, height, and native data.


createVignette(winningBid) @internal

Creates a vignette format using the Mafra's Ads library, with the winning bid rendered inside.

Parameters
Name Type Description
winningBid Object

The winning bid object returned from the auction, containing information such as adUnitCode, adId, width, height, and native data.


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

Used for header-bidding (must be async for consistency with all publishers)

Parameters
Name Type Description
hbKey string

Header bidding key

Returns

Element ID or null

Type: 
Promise.<(string|null)>

prepareMetaData(elementId, adUnit) @internal

Prepares an object with useful information for debubbing. Merges info from both adserver and prebid.

Parameters
Name Type Description
elementId string

Id of the ad container element where the ad is rendered.

adUnit string

AdUnit code corresponding to the ad being rendered, used to find the winning bid. If not provided, elementId is used as adUnit code.