Skip to content

Commit 30b73eb

Browse files
authored
✨ Yobee Ad Integration | New (#40278)
* Pixad Ad Integration * updated trailing whitespace. * fix * Update pixad.js * Update integration.js * Update amp-ad.md * Update pixad.md * AdMatic Ad Integration | New add support to amp-ad for the AdMatic type. * update * Update admatic.md * yobee * Update yobee.md * update * Update integration.js * Update yobee.js
1 parent 7e732ba commit 30b73eb

File tree

7 files changed

+118
-0
lines changed

7 files changed

+118
-0
lines changed

3p/vendors/yobee.js

+12
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 {yobee} from '#ads/vendors/yobee';
8+
9+
init(window);
10+
register('yobee', yobee);
11+
12+
window.draw3p = draw3p;

ads/_config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,8 @@ const adConfig = jsonConfiguration({
15511551
renderStartImplemented: true,
15521552
},
15531553

1554+
'yobee': {},
1555+
15541556
'zedo': {
15551557
prefetch: 'https://ss3.zedo.com/gecko/tag/Gecko.amp.min.js',
15561558
renderStartImplemented: true,

ads/vendors/yobee.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import {validateData, writeScript} from '#3p/3p';
2+
3+
/**
4+
* @param {!Window} global
5+
* @param {!Object} data
6+
*/
7+
export function yobee(global, data) {
8+
validateData(data, ['adNetwork', 'adPublisher', 'adTypeId']);
9+
global._yobee = global._yobee || {
10+
adNetwork: data['adPublisher'],
11+
publisher: data['adNetwork'],
12+
adTypeId: data['adTypeId'],
13+
host: `static.cdn.yobee.it`,
14+
prefix: `ybe`,
15+
};
16+
17+
const ins = global.document.createElement('ins');
18+
ins.setAttribute('data-publisher', global._yobee.publisher);
19+
if (global._yobee.adTypeId == 'standard') {
20+
ins.setAttribute('data-ad-size', `[[${data.width},${data.height}]]`);
21+
}
22+
ins.setAttribute('data-ad-network', global._yobee.adNetwork);
23+
ins.setAttribute('data-ad-type-id', global._yobee.adTypeId);
24+
ins.setAttribute('class', `${global._yobee.prefix}-ads-area`);
25+
global.document.getElementById('c').appendChild(ins);
26+
ins.parentNode.addEventListener('eventAdbladeRenderStart', () =>
27+
global.context.renderStart()
28+
);
29+
writeScript(global, `https://${global._yobee.host}/showad/showad.min.js`);
30+
}

ads/vendors/yobee.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Yobee
2+
3+
## Example of Yobee's model implementation
4+
5+
### Basic
6+
7+
```html
8+
<amp-ad
9+
type="yobee"
10+
width="300"
11+
height="250"
12+
data-ad-type-id="standard"
13+
data-ad-network="ybe-pub-7859401243"
14+
data-ad-publisher="677fa0cdfee472c84b643ca7">
15+
</amp-ad>
16+
```
17+
18+
### Sticky Ad
19+
20+
```html
21+
<amp-sticky-ad layout="nodisplay">
22+
<amp-ad
23+
type="yobee"
24+
width="320"
25+
height="100"
26+
data-ad-type-id="standard"
27+
data-ad-network="ybe-pub-7859401243"
28+
data-ad-publisher="677fa0cdfee472c84b643ca7">
29+
</amp-ad>
30+
</amp-sticky-ad>
31+
```
32+
33+
Note that `<amp-sticky-ad />` component requires the following script to be included in the page:
34+
35+
```html
36+
<script
37+
async
38+
custom-element="amp-sticky-ad"
39+
src="https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js"
40+
></script>
41+
```
42+
43+
## Configuration
44+
45+
For details on the configuration semantics, see [Yobee documentation](https://developer.yobee.it/).
46+
47+
### Required parameters
48+
49+
- `data-ad-network`: Network ID
50+
- `data-ad-publisher`: Publisher ID
51+
- `data-ad-type-id`: Model ID

examples/amp-ad/ads.amp.esm.html

+11
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
<option>yieldbot</option>
298298
<option>yieldmo</option>
299299
<option>yieldpro</option>
300+
<option>yobee</option>
300301
<option>zedo</option>
301302
<option>zen</option>
302303
<option>zergnet</option>
@@ -2417,6 +2418,16 @@ <h2>Yieldpro</h2>
24172418
data-slot="960">
24182419
</amp-ad>
24192420

2421+
<h2>Yobee</h2>
2422+
<amp-ad
2423+
type="yobee"
2424+
width="300"
2425+
height="250"
2426+
data-ad-type-id="standard"
2427+
data-ad-network="ybe-pub-7859401243"
2428+
data-ad-publisher="677fa0cdfee472c84b643ca7">
2429+
</amp-ad>
2430+
24202431
<h2>ValueCommerce</h2>
24212432
<amp-ad width="300" height="250"
24222433
type="valuecommerce"

examples/amp-ad/ads.amp.html

+11
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@
446446
<option>yieldbot</option>
447447
<option>yieldmo</option>
448448
<option>yieldpro</option>
449+
<option>yobee</option>
449450
<option>zedo</option>
450451
<option>zen</option>
451452
<option>zergnet</option>
@@ -2058,6 +2059,16 @@ <h2>Yieldpro</h2>
20582059
<amp-ad width="300" height="250" type="yieldpro" data-pubnetwork="12c6fc06" data-section-id="1299" data-slot="960">
20592060
</amp-ad>
20602061

2062+
<h2>Yobee</h2>
2063+
<amp-ad
2064+
type="yobee"
2065+
width="300"
2066+
height="250"
2067+
data-ad-type-id="standard"
2068+
data-ad-network="ybe-pub-7859401243"
2069+
data-ad-publisher="677fa0cdfee472c84b643ca7">
2070+
</amp-ad>
2071+
20612072
<h2>ValueCommerce</h2>
20622073
<amp-ad width="300" height="250" type="valuecommerce" data-sid="3008" data-pid="884466614">
20632074
</amp-ad>

extensions/amp-ad/amp-ad.md

+1
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
515515
- [Yieldmo](../../ads/vendors/yieldmo.md)
516516
- [Yieldone](../../ads/vendors/yieldone.md)
517517
- [Yieldpro](../../ads/vendors/yieldpro.md)
518+
- [Yobee](../../ads/vendors/yobee.md)
518519
- [Zedo](../../ads/vendors/zedo.md)
519520
- [Zucks](../../ads/vendors/zucks.md)
520521

0 commit comments

Comments
 (0)