Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨Prensa Ibérica amp-ad support #40138

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ register('openadstream', openadstream);
register('openx', openx);
register('opinary', opinary);
register('outbrain', outbrain);
register('piberica', piberica);
powerivq marked this conversation as resolved.
Show resolved Hide resolved
register('pixad', pixad);
register('pixels', pixels);
register('playstream', playstream);
Expand Down
12 changes: 12 additions & 0 deletions 3p/vendors/piberica.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 {piberica} from '#ads/vendors/piberica';

init(window);
register('piberica', piberica);

window.draw3p = draw3p;
5 changes: 5 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ const adConfig = jsonConfiguration({
consentHandlingOverride: true,
},

'piberica': {
preconnect: ['https://trafico.prensaiberica.es'],
renderStartImplemented: true,
},

'pixad': {},

'pixels': {
Expand Down
6 changes: 6 additions & 0 deletions ads/ads.extern.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,12 @@ data.dfpSlot;
data.nc;
data.auid;

// piberica.js
data.height;
data.publisher;
data.slot;
data.width;

// pixels.js
var pixelsAd;
var pixelsAMPAd;
Expand Down
25 changes: 25 additions & 0 deletions ads/vendors/piberica.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {loadScript, validateData} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function piberica(global, data) {
/*eslint "local/camelcase": 0*/
global._piberica_amp = {
allowed_data: ['publisher', 'slot'],
mandatory_data: ['publisher', 'slot'],
data,
};

validateData(
data,
global._piberica_amp.mandatory_data,
global._piberica_amp.allowed_data
);

loadScript(
global,
`https://trafico.prensaiberica.es/adm/min/intext/${data.publisher}/${data.slot}.js`
);
}
24 changes: 24 additions & 0 deletions ads/vendors/piberica.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PIberica

## Example

```html
<amp-ad
width="300"
height="1"
type="piberica"
layout="responsive"
data-publisher="test"
data-slot="1"
data-block-on-consent="_till_responded"
></amp-ad>
```

## Configuration

For further information, please contact [PIberica](https://www.prensaiberica360.es).

### Required parameters

- `data-publisher`: Publisher Integration ID provided by PIberica
- `data-slot`: Slot Integration ID provided by PIberica
9 changes: 9 additions & 0 deletions examples/amp-ad/ads.amp.esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
<option>openx</option>
<option>opinary</option>
<option>outbrain</option>
<option>piberica</option>
<option>pixad</option>
<option>pixels</option>
<option>plista</option>
Expand Down Expand Up @@ -1716,6 +1717,14 @@ <h2>Outbrain widget</h2>
data-testMode="true">
</amp-embed>

<h2>PIberica</h2>
<amp-ad width="300" height="1"
type="piberica"
layout="responsive"
data-publisher="test"
data-slot="1">
</amp-ad>

<h2>Pixad</h2>
<amp-ad
type="pixad"
Expand Down
9 changes: 9 additions & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
<option>openx</option>
<option>opinary</option>
<option>outbrain</option>
<option>piberica</option>
<option>pixad</option>
<option>pixels</option>
<option>playstream</option>
Expand Down Expand Up @@ -1521,6 +1522,14 @@ <h2>Outbrain widget</h2>
data-styleFile="http://localhost/style.css" data-testMode="true">
</amp-embed>

<h2>PIberica</h2>
<amp-ad width="300" height="1"
type="piberica"
layout="responsive"
data-publisher="test"
data-slot="1">
</amp-ad>

<h2>Pixad</h2>
<amp-ad
type="pixad"
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 @@ -424,6 +424,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [Open AdStream (OAS)](../../ads/vendors/openadstream.md)
- [OpenX](../../ads/vendors/openx.md)
- [opinary](../../ads/vendors/opinary.md)
- [PIberica](../../ads/vendors/piberica.md)
- [Pixad](../../ads/vendors/pixad.md)
- [Pixels](../../ads/vendors/pixels.md)
- [plista](../../ads/vendors/plista.md)
Expand Down