Skip to content

Commit

Permalink
add myua to vendors list (#36090)
Browse files Browse the repository at this point in the history
* add myua to vendors list

* fix year and cleaning

* remove copyright notices

* fix linter errors
  • Loading branch information
AntonMsk committed Sep 22, 2021
1 parent 232ec2e commit 5f4b536
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions 3p/integration-lib.js
Expand Up @@ -43,6 +43,7 @@ const AMP_EMBED_ALLOWED = {
mediaad: true,
mgid: true,
miximedia: true,
myua: true,
mywidget: true,
nativery: true,
lentainform: true,
Expand Down
12 changes: 12 additions & 0 deletions 3p/vendors/myua.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 {myua} from '#ads/vendors/myua';

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

window.draw3p = draw3p;
4 changes: 4 additions & 0 deletions ads/_config.js
Expand Up @@ -828,6 +828,10 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},

'myua': {
renderStartImplemented: true,
},

'mywidget': {
preconnect: 'https://likemore-fe.go.mail.ru',
prefetch: 'https://likemore-go.imgsmail.ru/widget_amp.js',
Expand Down
21 changes: 21 additions & 0 deletions ads/vendors/myua.js
@@ -0,0 +1,21 @@
import {validateData} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function myua(global, data) {
validateData(data, ['sid', 'iid'], ['demo', 'options']);

const informerTag = global.document.createElement('div');
informerTag.setAttribute('data-top-iid', data.iid);
global.document.body.appendChild(informerTag);

const demoSuffix = data.demo ? 'dev.' : '';
const scriptTag = global.document.createElement('script');
scriptTag.src = `https://amp.top-js-metrics.top.${demoSuffix}my.ua/script.js`;
scriptTag.setAttribute('async', 'true');
scriptTag.setAttribute('data-top-sid', data.sid);

global.document.body.appendChild(scriptTag);
}
30 changes: 30 additions & 0 deletions ads/vendors/myua.md
@@ -0,0 +1,30 @@
# MYUA

## Example

### Basic

```html
<amp-embed
width="300"
height="400"
type="myua"
data-sid="1"
data-iid="1"
>
</amp-embed>
```

## Configuration

For details on the configuration semantics, please contact the ad network or refer to their documentation.

### Required parameters

- `data-sid`
- `data-iid`

### Optional parameters

- `data-demo`
- `data-options`
5 changes: 5 additions & 0 deletions examples/amp-ad/ads.amp.html
Expand Up @@ -297,6 +297,7 @@
<option>myfinance</option>
<option>myoffrz</option>
<option>mytarget</option>
<option>myua</option>
<option>mywidget</option>
<option>nativeroll</option>
<option>nativery</option>
Expand Down Expand Up @@ -1497,6 +1498,10 @@ <h2>myTarget</h2>
<amp-ad width="300" height="250" type="mytarget" data-ad-slot="197378">
</amp-ad>

<h2>myua</h2>
<amp-ad width="300" height="400" type="myua" data-sid="3" data-iid="3" data-demo="true">
</amp-ad>

<h2>myWidget</h2>
<amp-embed width="300" height="250" type="mywidget" data-cid="ed1538fc077cfeae6ea558f6e7404541">
</amp-embed>
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Expand Up @@ -508,6 +508,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [Jubna](../../ads/vendors/jubna.md)
- [Lentainform](../../ads/vendors/lentainform.md)
- [Mgid](../../ads/vendors/mgid.md)
- [Myua](../../ads/vendors/myua.md)
- [Outbrain](../../ads/vendors/outbrain.md)
- [Postquare](../../ads/vendors/postquare.md)
- [PubExchange](../../ads/vendors/pubexchange.md)
Expand Down

0 comments on commit 5f4b536

Please sign in to comment.