From 2446633ff26c91f7ada2cf6a4745fe91a421161c Mon Sep 17 00:00:00 2001 From: Sergio Bonet Clement Date: Fri, 6 Sep 2024 12:44:27 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Prensa=20Ib=C3=A9rica=20amp-ad=20suppo?= =?UTF-8?q?rt=20(#40138)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prensa Ibérica amp ads support * remove changes from 3p/integration.js * remove changes from 3p/integration.js --------- Co-authored-by: Sergio Bonet --- 3p/vendors/piberica.js | 12 ++++++++++++ ads/_config.js | 5 +++++ ads/ads.extern.js | 6 ++++++ ads/vendors/piberica.js | 25 +++++++++++++++++++++++++ ads/vendors/piberica.md | 24 ++++++++++++++++++++++++ examples/amp-ad/ads.amp.esm.html | 9 +++++++++ examples/amp-ad/ads.amp.html | 9 +++++++++ extensions/amp-ad/amp-ad.md | 1 + 8 files changed, 91 insertions(+) create mode 100644 3p/vendors/piberica.js create mode 100644 ads/vendors/piberica.js create mode 100644 ads/vendors/piberica.md diff --git a/3p/vendors/piberica.js b/3p/vendors/piberica.js new file mode 100644 index 000000000000..4eb1888eb471 --- /dev/null +++ b/3p/vendors/piberica.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 {piberica} from '#ads/vendors/piberica'; + +init(window); +register('piberica', piberica); + +window.draw3p = draw3p; diff --git a/ads/_config.js b/ads/_config.js index 5fa24dc8703d..560ba24f2e9f 100755 --- a/ads/_config.js +++ b/ads/_config.js @@ -996,6 +996,11 @@ const adConfig = jsonConfiguration({ consentHandlingOverride: true, }, + 'piberica': { + preconnect: ['https://trafico.prensaiberica.es'], + renderStartImplemented: true, + }, + 'pixad': {}, 'pixels': { diff --git a/ads/ads.extern.js b/ads/ads.extern.js index 8343a845118f..084ec9302f34 100644 --- a/ads/ads.extern.js +++ b/ads/ads.extern.js @@ -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; diff --git a/ads/vendors/piberica.js b/ads/vendors/piberica.js new file mode 100644 index 000000000000..9ee70f5b09fc --- /dev/null +++ b/ads/vendors/piberica.js @@ -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` + ); +} diff --git a/ads/vendors/piberica.md b/ads/vendors/piberica.md new file mode 100644 index 000000000000..a2059549e176 --- /dev/null +++ b/ads/vendors/piberica.md @@ -0,0 +1,24 @@ +# PIberica + +## Example + +```html + +``` + +## 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 diff --git a/examples/amp-ad/ads.amp.esm.html b/examples/amp-ad/ads.amp.esm.html index 5125171a1c5c..25fb31ea8e42 100644 --- a/examples/amp-ad/ads.amp.esm.html +++ b/examples/amp-ad/ads.amp.esm.html @@ -215,6 +215,7 @@ + @@ -1716,6 +1717,14 @@

Outbrain widget

data-testMode="true"> +

PIberica

+ + +

Pixad

openx + @@ -1521,6 +1522,14 @@

Outbrain widget

data-styleFile="http://localhost/style.css" data-testMode="true"> +

PIberica

+ + +

Pixad