Skip to content

✨ Yobee Ad Integration | New #40278

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

Merged
merged 19 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions 3p/vendors/yobee.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 {yobee} from '#ads/vendors/yobee';

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

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

'yobee': {},

'zedo': {
prefetch: 'https://ss3.zedo.com/gecko/tag/Gecko.amp.min.js',
renderStartImplemented: true,
Expand Down
30 changes: 30 additions & 0 deletions ads/vendors/yobee.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {validateData, writeScript} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function yobee(global, data) {
validateData(data, ['adNetwork', 'adPublisher', 'adTypeId']);
global._yobee = global._yobee || {
adNetwork: data['adPublisher'],
publisher: data['adNetwork'],
adTypeId: data['adTypeId'],
host: `static.cdn.yobee.it`,
prefix: `ybe`,
};

const ins = global.document.createElement('ins');
ins.setAttribute('data-publisher', global._yobee.publisher);
if (global._yobee.adTypeId == 'standard') {
ins.setAttribute('data-ad-size', `[[${data.width},${data.height}]]`);
}
ins.setAttribute('data-ad-network', global._yobee.adNetwork);
ins.setAttribute('data-ad-type-id', global._yobee.adTypeId);
ins.setAttribute('class', `${global._yobee.prefix}-ads-area`);
global.document.getElementById('c').appendChild(ins);
ins.parentNode.addEventListener('eventAdbladeRenderStart', () =>
global.context.renderStart()
);
writeScript(global, `https://${global._yobee.host}/showad/showad.min.js`);
}
51 changes: 51 additions & 0 deletions ads/vendors/yobee.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Yobee

## Example of Yobee's model implementation

### Basic

```html
<amp-ad
type="yobee"
width="300"
height="250"
data-ad-type-id="standard"
data-ad-network="ybe-pub-7859401243"
data-ad-publisher="677fa0cdfee472c84b643ca7">
</amp-ad>
```

### Sticky Ad

```html
<amp-sticky-ad layout="nodisplay">
<amp-ad
type="yobee"
width="320"
height="100"
data-ad-type-id="standard"
data-ad-network="ybe-pub-7859401243"
data-ad-publisher="677fa0cdfee472c84b643ca7">
</amp-ad>
</amp-sticky-ad>
```

Note that `<amp-sticky-ad />` component requires the following script to be included in the page:

```html
<script
async
custom-element="amp-sticky-ad"
src="https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js"
></script>
```

## Configuration

For details on the configuration semantics, see [Yobee documentation](https://developer.yobee.it/).

### Required parameters

- `data-ad-network`: Network ID
- `data-ad-publisher`: Publisher ID
- `data-ad-type-id`: Model ID
11 changes: 11 additions & 0 deletions examples/amp-ad/ads.amp.esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
<option>yieldbot</option>
<option>yieldmo</option>
<option>yieldpro</option>
<option>yobee</option>
<option>zedo</option>
<option>zen</option>
<option>zergnet</option>
Expand Down Expand Up @@ -2417,6 +2418,16 @@ <h2>Yieldpro</h2>
data-slot="960">
</amp-ad>

<h2>Yobee</h2>
<amp-ad
type="yobee"
width="300"
height="250"
data-ad-type-id="standard"
data-ad-network="ybe-pub-7859401243"
data-ad-publisher="677fa0cdfee472c84b643ca7">
</amp-ad>

<h2>ValueCommerce</h2>
<amp-ad width="300" height="250"
type="valuecommerce"
Expand Down
11 changes: 11 additions & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
<option>yieldbot</option>
<option>yieldmo</option>
<option>yieldpro</option>
<option>yobee</option>
<option>zedo</option>
<option>zen</option>
<option>zergnet</option>
Expand Down Expand Up @@ -2058,6 +2059,16 @@ <h2>Yieldpro</h2>
<amp-ad width="300" height="250" type="yieldpro" data-pubnetwork="12c6fc06" data-section-id="1299" data-slot="960">
</amp-ad>

<h2>Yobee</h2>
<amp-ad
type="yobee"
width="300"
height="250"
data-ad-type-id="standard"
data-ad-network="ybe-pub-7859401243"
data-ad-publisher="677fa0cdfee472c84b643ca7">
</amp-ad>

<h2>ValueCommerce</h2>
<amp-ad width="300" height="250" type="valuecommerce" data-sid="3008" data-pid="884466614">
</amp-ad>
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 @@ -515,6 +515,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [Yieldmo](../../ads/vendors/yieldmo.md)
- [Yieldone](../../ads/vendors/yieldone.md)
- [Yieldpro](../../ads/vendors/yieldpro.md)
- [Yobee](../../ads/vendors/yobee.md)
- [Zedo](../../ads/vendors/zedo.md)
- [Zucks](../../ads/vendors/zucks.md)

Expand Down
Loading