diff --git a/3p/vendors/playwire.js b/3p/vendors/playwire.js new file mode 100644 index 000000000000..70fe4723d22c --- /dev/null +++ b/3p/vendors/playwire.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 {playwire} from '#ads/vendors/playwire'; + +init(window); +register('playwire', playwire); + +window.draw3p = draw3p; diff --git a/ads/_config.js b/ads/_config.js index eef98ef7f564..8416eb80cefd 100755 --- a/ads/_config.js +++ b/ads/_config.js @@ -1038,6 +1038,14 @@ const adConfig = jsonConfiguration({ renderStartImplemented: true, }, + 'playwire': { + prefetch: [ + 'https://securepubads.g.doubleclick.net/tag/js/gpt.js', + 'https://cdn.intergient.com/amp/amp.js', + ], + renderStartImplemented: true, + }, + 'plista': {}, 'polymorphicads': { diff --git a/ads/vendors/playwire.js b/ads/vendors/playwire.js new file mode 100644 index 000000000000..6a6688c3ba7c --- /dev/null +++ b/ads/vendors/playwire.js @@ -0,0 +1,30 @@ +import {loadScript, validateData} from '#3p/3p'; + +/** + * @param {!Window} global + * @param {!Object} data + */ +export function playwire(global, data) { + /*eslint "local/camelcase": 0*/ + global.playwire = { + allowed_data: [ + 'publisher', + 'website', + 'slot', + 'path', + 'slotNumber', + 'json', + ], + mandatory_data: ['publisher', 'website', 'slot'], + isAmp: true, + data, + }; + + validateData( + data, + global.playwire.mandatory_data, + global.playwire.allowed_data + ); + + loadScript(global, `https://cdn.intergient.com/amp/amp.js`); +} diff --git a/ads/vendors/playwire.md b/ads/vendors/playwire.md new file mode 100644 index 000000000000..45b12a26b125 --- /dev/null +++ b/ads/vendors/playwire.md @@ -0,0 +1,21 @@ +# Playwire + +## Example + +```html + + +``` + +## Configuration +Each site must be approved and onboarded with Playwire prior to launch. Please visit [Playwire](https://www.playwire.com) for more information. The values provided to the tag must match the identifiers assigned within your Playwire implementation. For testing you can use the tag example above. + +### Required parameters + +- `data-publisher` - The Playwire publisher ID assigned to the property. +- `data-website` - The website ID associated with the property. +- `data-slot` - The Playwire slot identifier corresponding to the ad unit. + +### Optional parameters + +- `data-json` - JSON object to configure additional settings. Refer to Playwire documentation for supported options. diff --git a/examples/amp-ad/ads.amp.html b/examples/amp-ad/ads.amp.html index cd43667fcfb0..715cee39719f 100644 --- a/examples/amp-ad/ads.amp.html +++ b/examples/amp-ad/ads.amp.html @@ -352,6 +352,7 @@ + @@ -1560,6 +1561,10 @@

PlayStream

data-fluid="true" layout="responsive">
+

Playwire

+ + +

Plista responsive widget