Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions 3p/vendors/playwire.js
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 8 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
30 changes: 30 additions & 0 deletions ads/vendors/playwire.js
Original file line number Diff line number Diff line change
@@ -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`);
}
21 changes: 21 additions & 0 deletions ads/vendors/playwire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Playwire

## Example

```html
<amp-ad width="320" height="250" id="playwire_ad2" type="playwire" data-publisher="343" data-website="926" data-slot="standard_iab_cntr3" data-path="/testme" layout="fixed" data-slot-number="2">
</amp-ad>
```

## 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 <amp-ad> 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.
5 changes: 5 additions & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
<option>pixad</option>
<option>pixels</option>
<option>playstream</option>
<option>Playwire</option>
<option>plista</option>
<option>polymorphicads</option>
<option>popin</option>
Expand Down Expand Up @@ -1560,6 +1561,10 @@ <h2>PlayStream</h2>
data-fluid="true" layout="responsive">
</amp-ad>

<h2>Playwire</h2>
<amp-ad width="320" height="250" id="playwire_ads" type="playwire" data-publisher="343" data-website="926" data-slot="standard_iab_cntr3" data-path="/testme" layout="fixed">
</amp-ad>

<h2>Plista responsive widget</h2>
<amp-embed width="300" height="300" type="plista" layout=responsive data-countrycode="de"
data-publickey="e6a75b42216ffc96b7ea7ad0c94d64946aedaac4" data-widgetname="iAMP_2" data-geo="de" data-urlprefix=""
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [PIberica](../../ads/vendors/piberica.md)
- [Pixad](../../ads/vendors/pixad.md)
- [Pixels](../../ads/vendors/pixels.md)
- [Playwire](../../ads/vendors/playwire.md)
- [plista](../../ads/vendors/plista.md)
- [polymorphicAds](../../ads/vendors/polymorphicads.md)
- [popin](../../ads/vendors/popin.md)
Expand Down
Loading