diff --git a/3p/integration.js b/3p/integration.js index bdb95631b6cd..3c04e2d0dd72 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -49,6 +49,7 @@ import {adincube} from '#ads/vendors/adincube'; import {adition} from '#ads/vendors/adition'; import {adman} from '#ads/vendors/adman'; import {admanmedia} from '#ads/vendors/admanmedia'; +import {admatic} from '#ads/vendors/admatic'; import {admixer} from '#ads/vendors/admixer'; import {adnuntius} from '#ads/vendors/adnuntius'; import {adocean} from '#ads/vendors/adocean'; @@ -332,6 +333,7 @@ register('adincube', adincube); register('adition', adition); register('adman', adman); register('admanmedia', admanmedia); +register('admatic', admatic); register('admixer', admixer); register('adnuntius', adnuntius); register('adocean', adocean); diff --git a/3p/vendors/admatic.js b/3p/vendors/admatic.js new file mode 100644 index 000000000000..725738aa2a47 --- /dev/null +++ b/3p/vendors/admatic.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 {admatic} from '#ads/vendors/admatic'; + +init(window); +register('admatic', admatic); + +window.draw3p = draw3p; diff --git a/ads/_config.js b/ads/_config.js index 3dc949da333d..bdb6708f577b 100755 --- a/ads/_config.js +++ b/ads/_config.js @@ -137,6 +137,8 @@ const adConfig = jsonConfiguration({ renderStartImplemented: true, }, + 'admatic': {}, + 'admixer': { renderStartImplemented: true, preconnect: ['https://inv-nets.admixer.net', 'https://cdn.admixer.net'], diff --git a/ads/vendors/admatic.js b/ads/vendors/admatic.js new file mode 100644 index 000000000000..099b4c597335 --- /dev/null +++ b/ads/vendors/admatic.js @@ -0,0 +1,37 @@ +import {validateData, writeScript} from '#3p/3p'; + +/** + * @param {!Window} global + * @param {!Object} data + */ +export function admatic(global, data) { + validateData(data, ['adNetwork', 'adPublisher', 'adTypeId']); + global._admatic = global._admatic || { + publisher: data['adNetwork'], + adNetwork: data['adPublisher'], + adTypeId: data['adTypeId'], + host: `static.cdn.admatic.com.tr`, + prefix: `px`, + }; + + if (global._admatic.publisher.indexOf('adm-pub') != -1) { + global._admatic.host = `static.cdn.admatic.com.tr`; + global._admatic.prefix = `adm`; + } + + const ins = global.document.createElement('ins'); + ins.setAttribute('data-publisher', global._admatic.publisher); + if (global._admatic.adTypeId == 'standard') { + ins.setAttribute('data-ad-size', `[[${data.width},${data.height}]]`); + } + ins.setAttribute('data-ad-network', global._admatic.adNetwork); + ins.setAttribute('data-ad-type-id', global._admatic.adTypeId); + ins.setAttribute('class', `${global._admatic.prefix}-ads-area`); + global.document.getElementById('c').appendChild(ins); + ins.parentNode.addEventListener( + 'eventAdbladeRenderStart', + global.context.renderStart() + ); + + writeScript(global, `https://${global._admatic.host}/showad/showad.min.js`); +} diff --git a/ads/vendors/admatic.md b/ads/vendors/admatic.md new file mode 100644 index 000000000000..65fe1ab5a8e3 --- /dev/null +++ b/ads/vendors/admatic.md @@ -0,0 +1,51 @@ +# Pixad + +## Example of Pixad's model implementation + +### Basic + +```html + + +``` + +### Sticky Ad + +```html + + + + +``` + +Note that `` component requires the following script to be included in the page: + +```html + +``` + +## Configuration + +For details on the configuration semantics, see [AdMatic documentation](https://developer.admatic.com.tr/). + +### Required parameters + +- `data-ad-network`: Network ID +- `data-ad-publisher`: Publisher ID +- `data-ad-type-id`: Model ID diff --git a/examples/amp-ad/ads.amp.esm.html b/examples/amp-ad/ads.amp.esm.html index c92aabae50b9..a366254ba0af 100644 --- a/examples/amp-ad/ads.amp.esm.html +++ b/examples/amp-ad/ads.amp.esm.html @@ -85,6 +85,7 @@ + @@ -512,6 +513,16 @@

AdmanMedia

data-id="8e916419"> +

AdMatic

+ + +

Admixer

adition + @@ -581,6 +582,16 @@

AdmanMedia

+

AdMatic

+ + +

Admixer

diff --git a/extensions/amp-ad/amp-ad.md b/extensions/amp-ad/amp-ad.md index a5a946b24e6c..427f354aadb0 100644 --- a/extensions/amp-ad/amp-ad.md +++ b/extensions/amp-ad/amp-ad.md @@ -269,6 +269,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati - [ADITION](../../ads/vendors/adition.md) - [Adman](../../ads/vendors/adman.md) - [AdmanMedia](../../ads/vendors/admanmedia.md) +- [AdMatic](../../ads/vendors/admatic.md) - [Admixer](../../ads/vendors/admixer.md) - [Adnuntius](../../ads/vendors/adnuntius.md) - [AdOcean](../../ads/vendors/adocean.md)