diff --git a/3p/integration.js b/3p/integration.js index 99d75510a309..cbcf7d9f14e0 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -83,6 +83,7 @@ import {aja} from '#ads/vendors/aja'; import {amoad} from '#ads/vendors/amoad'; import {aniview} from '#ads/vendors/aniview'; import {anyclip} from '#ads/vendors/anyclip'; +import {appmonsta} from '#ads/vendors/appmonsta'; import {appnexus} from '#ads/vendors/appnexus'; import {appvador} from '#ads/vendors/appvador'; import {atomx} from '#ads/vendors/atomx'; @@ -367,6 +368,7 @@ register('aja', aja); register('amoad', amoad); register('aniview', aniview); register('anyclip', anyclip); +register('appmonsta', appmonsta); register('appnexus', appnexus); register('appvador', appvador); register('atomx', atomx); diff --git a/3p/vendors/appmonsta.js b/3p/vendors/appmonsta.js new file mode 100644 index 000000000000..642b7b4717f8 --- /dev/null +++ b/3p/vendors/appmonsta.js @@ -0,0 +1,12 @@ +// src/polyfills.js must be the first import. +import '#3p/polyfills'; + +import {register} from '#3p/3p'; +import {draw3p, init} from '#3p/integration-lib'; + +import {appmonsta} from '#ads/vendors/appmonsta'; + +init(window); +register('appmonsta', appmonsta); + +window.draw3p = draw3p; diff --git a/ads/_config.js b/ads/_config.js index 81fb78ac60c1..3ef0dda0665c 100755 --- a/ads/_config.js +++ b/ads/_config.js @@ -350,6 +350,10 @@ const adConfig = jsonConfiguration({ renderStartImplemented: true, }, + 'appmonsta': { + preconnect: 'https://ssp.appmonsta.ai', + }, + 'appnexus': { prefetch: 'https://acdn.adnxs.com/ast/ast.js', preconnect: 'https://ib.adnxs.com', diff --git a/ads/vendors/appmonsta.js b/ads/vendors/appmonsta.js new file mode 100644 index 000000000000..253f389dfa20 --- /dev/null +++ b/ads/vendors/appmonsta.js @@ -0,0 +1,30 @@ +import {validateData, writeScript} from '#3p/3p'; + +/** + * @param {!Window} global + * @param {!Object} data + */ +export function appmonsta(global, data) { + validateData(data, ['placementId']); + + const {location} = global.context; + let url = 'https://ssp.appmonsta.ai?c=b&m=amp'; + + const params = [ + ['placementId', encodeURIComponent(data.placementId)], + ['ua', encodeURIComponent(global.navigator?.userAgent)], + ['w', data.width], + ['h', data.height], + ['domain', location.host], + ['page', location.pathname], + ['secure', location.protocol === 'https:' ? 1 : 0], + ['language', global.navigator?.language], + ]; + + for (let i = 0; i < params.length; i++) { + const param = params[i]; + url = `${url}&${param[0]}=${param[1] ?? ''}`; + } + + writeScript(global, url); +} diff --git a/ads/vendors/appmonsta.md b/ads/vendors/appmonsta.md new file mode 100644 index 000000000000..e22783dce9d5 --- /dev/null +++ b/ads/vendors/appmonsta.md @@ -0,0 +1,17 @@ +# AppMonsta + +## Basic example + +```html + + +``` + +### Required parameters + +- `placement-id`: Placement Id diff --git a/examples/amp-ad/ads.amp.esm.html b/examples/amp-ad/ads.amp.esm.html index 099256d31ec9..57097bf7b0e3 100644 --- a/examples/amp-ad/ads.amp.esm.html +++ b/examples/amp-ad/ads.amp.esm.html @@ -116,6 +116,7 @@ + @@ -833,6 +834,15 @@

Aniview

data-channelId="5a5f17a728a06102d14c2718"> +

AppMonsta

+ + +

AppNexus with JSON based configuration multi ad

diff --git a/examples/amp-ad/ads.amp.html b/examples/amp-ad/ads.amp.html index 4471866b688f..f125878387f6 100644 --- a/examples/amp-ad/ads.amp.html +++ b/examples/amp-ad/ads.amp.html @@ -222,6 +222,7 @@ + @@ -812,6 +813,10 @@

AnyClip

data-widgetname="amp_test_autoplay" data-ac-embed-mode="plain" data-ourl="https://anyclip.com/">
+

AppMonsta

+ + +

AppNexus with JSON based configuration multi ad

diff --git a/extensions/amp-ad/amp-ad.md b/extensions/amp-ad/amp-ad.md index 5625cd5c0de3..76db900ab8d9 100644 --- a/extensions/amp-ad/amp-ad.md +++ b/extensions/amp-ad/amp-ad.md @@ -307,6 +307,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati - [Andbeyond](../../ads/vendors/andbeyond.md) - [Aniview](../../ads/vendors/aniview.md) - [AnyClip](../../ads/vendors/anyclip.md) +- [AppMonsta](../../ads/vendors/appmonsta.md) - [AppNexus](../../ads/vendors/appnexus.md) - [AppVador](../../ads/vendors/appvador.md) - [Atomx](../../ads/vendors/atomx.md)