Banner

There are some advertisement settings in the playgama-bridge-config.json file

Playgama Bridge Config

Is Banner Supported

Check if the platform supports displaying banner ads. Use this to determine if you can include banner advertisements in your game

bridge.advertisement.isBannerSupported

Ensure that in-game banners are not displayed during gameplay on CrazyGames. Please refer to Advertisement - CrazyGames Documentation.

Show Banner

Display a banner ad within your game to generate revenue through advertising.

let position = 'bottom' // optional, 'top' | 'bottom', default = bottom
let placement = 'test_placement' // optional
bridge.advertisement.showBanner(position, placement)

Hide Banner

Hide the currently displayed banner ad when it is no longer needed.

bridge.advertisement.hideBanner()

Monitor the state of the banner ad (loading, shown, hidden, failed) to manage its display and troubleshoot issues.

bridge.advertisement.bannerState
// Listen for banner state changes
bridge.advertisement.on(bridge.EVENT_NAME.BANNER_STATE_CHANGED, state => {
    console.log('Banner state: ', state)
})

Possible values: loading, shown, hidden, failed.

Last updated