Skip to content

Commit d031873

Browse files
jarrettabelloThomas Creamer
authored andcommitted
Set up Playwire amp-ad module
1 parent a43d97c commit d031873

File tree

6 files changed

+69
-0
lines changed

6 files changed

+69
-0
lines changed

3p/vendors/playwire.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// src/polyfills.js must be the first import.
2+
import '#3p/polyfills';
3+
4+
import {register} from '#3p/3p';
5+
import {draw3p, init} from '#3p/integration-lib';
6+
7+
import {playwire} from '#ads/vendors/playwire';
8+
9+
init(window);
10+
register('playwire', playwire);
11+
12+
window.draw3p = draw3p;

ads/_config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,14 @@ const adConfig = jsonConfiguration({
10381038
renderStartImplemented: true,
10391039
},
10401040

1041+
'playwire': {
1042+
prefetch: [
1043+
'https://securepubads.g.doubleclick.net/tag/js/gpt.js',
1044+
'https://cdn.intergient.com/amp/amp.js'
1045+
],
1046+
renderStartImplemented: true
1047+
},
1048+
10411049
'plista': {},
10421050

10431051
'polymorphicads': {

ads/vendors/playwire.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { loadScript, validateData, computeInMasterFrame } from '#3p/3p';
2+
3+
/**
4+
* @param {!Window} global
5+
* @param {!Object} data
6+
*/
7+
export function playwire(global, data) {
8+
/*eslint "local/camelcase": 0*/
9+
global.playwire = {
10+
allowed_data: ['publisher', 'website', 'slot', 'path', 'slotNumber'],
11+
mandatory_data: ['publisher', 'website', 'slot'],
12+
isAmp: true,
13+
data,
14+
};
15+
16+
validateData(
17+
data,
18+
global.playwire.mandatory_data,
19+
global.playwire.allowed_data
20+
);
21+
22+
loadScript(
23+
global,
24+
`https://cdn.intergient.com/amp/amp.js`
25+
);
26+
}

ads/vendors/playwire.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Playwire
2+
3+
## Example
4+
5+
```html
6+
<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">
7+
</amp-ad>
8+
```
9+
10+
## Configuration
11+
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.
12+
13+
### Required parameters
14+
15+
- `data-publisher` - The Playwire publisher ID assigned to the property.
16+
- `data-website` - The website ID associated with the property.
17+
- `data-slot` - The Playwire slot identifier corresponding to the ad unit.

examples/amp-ad/ads.amp.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@
352352
<option>pixad</option>
353353
<option>pixels</option>
354354
<option>playstream</option>
355+
<option>Playwire</option>
355356
<option>plista</option>
356357
<option>polymorphicads</option>
357358
<option>popin</option>
@@ -1560,6 +1561,10 @@ <h2>PlayStream</h2>
15601561
data-fluid="true" layout="responsive">
15611562
</amp-ad>
15621563

1564+
<h2>Playwire</h2>
1565+
<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">
1566+
</amp-ad>
1567+
15631568
<h2>Plista responsive widget</h2>
15641569
<amp-embed width="300" height="300" type="plista" layout=responsive data-countrycode="de"
15651570
data-publickey="e6a75b42216ffc96b7ea7ad0c94d64946aedaac4" data-widgetname="iAMP_2" data-geo="de" data-urlprefix=""

extensions/amp-ad/amp-ad.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
429429
- [PIberica](../../ads/vendors/piberica.md)
430430
- [Pixad](../../ads/vendors/pixad.md)
431431
- [Pixels](../../ads/vendors/pixels.md)
432+
- [Playwire](../../ads/vendors/playwire.md)
432433
- [plista](../../ads/vendors/plista.md)
433434
- [polymorphicAds](../../ads/vendors/polymorphicads.md)
434435
- [popin](../../ads/vendors/popin.md)

0 commit comments

Comments
 (0)