forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Prensa Ibérica amp-ad support (ampproject#40138)
* Prensa Ibérica amp ads support * remove changes from 3p/integration.js * remove changes from 3p/integration.js --------- Co-authored-by: Sergio Bonet <sbonet@pi360.es>
- Loading branch information
1 parent
d399642
commit 2446633
Showing
8 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters