Skip to content

Commit

Permalink
Add Sevio vendor (#39982)
Browse files Browse the repository at this point in the history
* Sevio Vendor skeleton

* Sevio Vendor skeleton config. Prefetch js

* Modify sevio.js file

* Modify path to amp.js instead of loader-amp.js

* Update path to CDN amp.js

* Fix sevio width and height - linter errors

* Added extra new line before and after sevio in the _config.js
  • Loading branch information
petrican committed May 8, 2024
1 parent 6b27356 commit 727eddc
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import {runative} from '#ads/vendors/runative';
import {sas} from '#ads/vendors/sas';
import {seedingalliance} from '#ads/vendors/seedingalliance';
import {sekindo} from '#ads/vendors/sekindo';
import {sevio} from '#ads/vendors/sevio';
import {sharethrough} from '#ads/vendors/sharethrough';
import {shemedia} from '#ads/vendors/shemedia';
import {sklik} from '#ads/vendors/sklik';
Expand Down Expand Up @@ -530,6 +531,7 @@ register('runative', runative);
register('sas', sas);
register('seedingalliance', seedingalliance);
register('sekindo', sekindo);
register('sevio', sevio);
register('sharethrough', sharethrough);
register('shemedia', shemedia);
register('sklik', sklik);
Expand Down
12 changes: 12 additions & 0 deletions 3p/vendors/sevio.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 {sevio} from '#ads/vendors/sevio';

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

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

'sevio': {
preconnect: ['https://request.adx.ws'],
prefetch: ['https://cdn.adx.ws/scripts/amp.js'],
renderStartImplemented: true,
},

'sharethrough': {
renderStartImplemented: true,
},
Expand Down
33 changes: 33 additions & 0 deletions ads/vendors/sevio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {loadScript, validateData} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function sevio(global, data) {
validateData(data, ['zone']);

const container = document.getElementById('c');
const adDivId = 'sevioads-amp-' + encodeURIComponent(data.zone);
const adDiv = document.createElement('div');
adDiv.setAttribute('id', adDivId);
container.appendChild(adDiv);

loadScript(
global,
'https://cdn.adx.ws/scripts/amp.js',
() => {
window.sevioAmpLoader = window.sevioAmpLoader || [];
window.sevioAmpLoader.push({
zoneId: encodeURIComponent(data.zone),
placeholderId: encodeURIComponent(adDivId),
wu: window.location.href,
width: data.width,
height: data.height,
});
},
() => {
global.context.noContentAvailable();
}
);
}
19 changes: 19 additions & 0 deletions ads/vendors/sevio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Sevio

## Example of Sevio's model implementation

### Basic

```html
<amp-ad
type="sevio"
width="300"
height="250"
data-zone="zoneId"
>
</amp-ad>
```

### Required parameters

- `data-zone`: Zone ID
7 changes: 7 additions & 0 deletions examples/amp-ad/ads.amp.esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
<option>sas</option>
<option>seedingalliance</option>
<option>sekindo</option>
<option>sevio</option>
<option>sharethrough</option>
<option>shemedia</option>
<option>sklik</option>
Expand Down Expand Up @@ -2014,6 +2015,12 @@ <h2>Sekindo</h2>
data-spaceId="14071">
</amp-ad>

<h2>Sevio</h2>
<amp-ad width="300" height="250"
type="sevio"
data-zone="38da4be8-5d6e-4767-9d7c-0694c28343fc">
</amp-ad>

<h2>Sharethrough</h2>
<amp-ad width="300" height="150"
type="sharethrough"
Expand Down
5 changes: 5 additions & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
<option>seedingalliance</option>
<option>seedtag</option>
<option>sekindo</option>
<option>sevio</option>
<option>sharethrough</option>
<option>shemedia</option>
<option>sklik</option>
Expand Down Expand Up @@ -1778,6 +1779,10 @@ <h2>Sekindo</h2>
<amp-ad width="300" height="250" type="sekindo" data-spaceId="14071">
</amp-ad>

<h2>Sevio</h2>
<amp-ad width="300" height="250" type="sevio" data-zone="38da4be8-5d6e-4767-9d7c-0694c28343fc">
</amp-ad>

<h2>Sharethrough</h2>
<amp-ad width="300" height="150" type="sharethrough" layout="responsive" data-pkey="c0fa8367">
</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 @@ -461,6 +461,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [SAS CI 360 Match](../../ads/vendors/sas.md)
- [Seeding Alliance](../../ads/vendors/seedingalliance.md)
- [Sekindo](../../ads/vendors/sekindo.md)
- [Sevio](../../ads/vendors/sevio.md)
- [Sharethrough](../../ads/vendors/sharethrough.md)
- [SHE Media](../../ads/vendors/shemedia.md)
- [Sklik](../../ads/vendors/sklik.md)
Expand Down

0 comments on commit 727eddc

Please sign in to comment.