Skip to main content

ad-reload

Moli's own Ad Reload solution to optimize long lived user sessions by reloading specific ad slots.

Integration

In your index.ts, import AdReload and register the module.

import { createAdReload } from '@highfivve/module-moli-ad-reload';

moli.registerModule(createAdReload());

Interfaces

IAdReloadModule

Extends

  • IModule

Properties

adVisibilityService

readonly adVisibilityService: undefined | AdVisibilityService

description

readonly description: string

Inherited from

IModule.description

moduleType

readonly moduleType: string

Inherited from

IModule.moduleType

name

readonly name: string

Inherited from

IModule.name

Methods

config__()

config__(): null | Object

If the module has some sort of configuration this can be fetched with this method

Returns

null | Object

Inherited from

IModule.config__

configureSteps__()

configureSteps__(): ConfigureStep[]

Returns a list of steps that should be executed in the ad pipeline.

Returns

ConfigureStep[]

Inherited from

IModule.configureSteps__

configure__()

configure__(moduleConfig?): void

Initialize the module with the given module configuration. Depending on the configuration the module may become active or inactive.

Parameters

moduleConfig?: ModulesConfig

Returns

void

Inherited from

IModule.configure__

initSteps__()

initSteps__(): InitStep[]

Returns a list of steps that should be executed in the ad pipeline.

Returns

InitStep[]

Inherited from

IModule.initSteps__

initialize()

initialize(context, config, slotsToMonitor, reloadAdSlotCallback): void

Parameters

context: AdPipelineContext

config: AdReloadModuleConfig

slotsToMonitor: string[]

reloadAdSlotCallback

Returns

void

isInitialized()

isInitialized(): boolean

Returns

boolean

prebidBidsBackHandler__()?

optional prebidBidsBackHandler__(): PrebidBidsBackHandler[]

This method is called in the bidsBackHandler of prebid.

A module may provide those callbacks if it needs to alter the requests send to the ad server. The auctionEnd event cannot be used for this, as there's no guarantee the event handler will run before the requestAds step.

Note: Amazon TAM (A9) also has a callback that could be used for similar things. Unfortunately does the callback not provide the necessary information to implement any meaningful business logic. Especially the cpm parameter and bidder

The callback receives additional information coming from the ad pipeline run.

Note: These callbacks should not perform any initialization code or only be created once as this array will be accessed on every pbjs.requestBids() callback.

Use cases

The generic-skin module provides prebid bids back handlers to block certain ad units from being requested.

Returns

PrebidBidsBackHandler[]

See
Inherited from

IModule.prebidBidsBackHandler__

prepareRequestAdsSteps__()

prepareRequestAdsSteps__(): PrepareRequestAdsStep[]

Returns a list of steps that should be executed in the ad pipeline.

Returns

PrepareRequestAdsStep[]

Inherited from

IModule.prepareRequestAdsSteps__

requestBidsSteps__()?

optional requestBidsSteps__(): RequestBidsStep[]

Returns a list of steps that should be executed in the ad pipeline.

This step is optional, as should have been all steps to reduce implementation complexity of modules.

Note: prebid and amazon tam (a9) maybe implemented as modules in the future as they add those steps to the ad pipeline.

Returns

RequestBidsStep[]

Inherited from

IModule.requestBidsSteps__

Functions

createAdReload()

createAdReload(): IAdReloadModule

This module can be used to refresh ads based on user activity after a certain amount of time that the ad was visible.

Returns

IAdReloadModule