Constructor
new PublisherMafra(main)
Constructor of PublisherMafra class
| Name | Type | Description |
|---|---|---|
main |
Object | Instance of the main CpexPackage class |
Methods
reRender(elementId, adUnitopt)
Wraps HB reRender to add metadata
| Name | Type | Attributes | Description |
|---|---|---|---|
elementId |
string | Element ID |
|
adUnit |
string | <optional> | Ad unit name |
(async) refresh(adUnitsopt) → {Promise.<boolean>}
Refreshes specific ad positions for Mafra
| Name | Type | Attributes | Description |
|---|---|---|---|
adUnits |
Array. |
<optional> | Array of adUnit codes to refresh |
True if successful
- Type:
-
Promise.
<boolean>
createSlideup(winningBid)
Creates a slideup format using the Mafra's Ads library, with the winning bid rendered inside. Supports both native and iframe ads.
| 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)
Creates a vignette format using the Mafra's Ads library, with the winning bid rendered inside.
| 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)>}
Used for header-bidding (must be async for consistency with all publishers)
| Name | Type | Description |
|---|---|---|
hbKey |
string | Header bidding key |
Element ID or null
- Type:
-
Promise.
<(string| null)>
prepareMetaData(elementId, adUnit)
Prepares an object with useful information for debubbing. Merges info from both adserver and prebid.
| 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. |