Skip to content
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

Add mox.tv ad network integration for amp-ad #20076

Merged
merged 5 commits into from
Jan 9, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ import {microad} from '../ads/microad';
import {miximedia} from '../ads/miximedia';
import {mixpo} from '../ads/mixpo';
import {monetizer101} from '../ads/monetizer101';
import {mox} from '../ads/mox';
import {mytarget} from '../ads/mytarget';
import {mywidget} from '../ads/mywidget';
import {nativo} from '../ads/nativo';
Expand Down Expand Up @@ -404,6 +405,7 @@ register('microad', microad);
register('miximedia', miximedia);
register('mixpo', mixpo);
register('monetizer101', monetizer101);
register('mox', mox);
register('mytarget', mytarget);
register('mywidget', mywidget);
register('nativo', nativo);
Expand Down
8 changes: 8 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,14 @@ export const adConfig = {
renderStartImplemented: true,
},

'mox': {
prefetch: [
'https://ad.mox.tv/js/amp.min.js',
'https://ad.mox.tv/mox/mwayss_invocation.min.js',
],
renderStartImplemented: true,
},

'mytarget': {
prefetch: 'https://ad.mail.ru/static/ads-async.js',
renderStartImplemented: true,
Expand Down
29 changes: 29 additions & 0 deletions ads/mox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {loadScript, validateData} from '../3p/3p';

/**
* @param {!Window} global
* @param {!Object} config
*/
export function mox(global, config) {
validateData(config, ['z', 'w', 'h'], ['u']);

global.config = config;

loadScript(global, config.u || 'https://ad.mox.tv/js/amp.min.js');
}
42 changes: 42 additions & 0 deletions ads/mox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!---
Copyright 2018 The AMP HTML Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# mox.tv

Please visit our [website](https://mox.tv) for more information about us.

## Example

```html
<amp-ad height="1"
type="mox"
data-z="1183"
data-w="720"
data-h="405">
</amp-ad>
```

## Configuration

#### Required parameters:

- `data-z` — Ad zone unique id
- `data-w` — Ad unit width
- `data-h` — Ad unit height

#### Optional parameters:

- `data-u` — URL of invocation script
9 changes: 9 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<option>miximedia</option>
<option>mixpo</option>
<option>monetizer101</option>
<option>mox</option>
<option>mytarget</option>
<option>mywidget</option>
<option>nativo</option>
Expand Down Expand Up @@ -1268,6 +1269,14 @@ <h2>Monetizer101</h2>
data-config='{"shopId": 1, "priceMin": 500, "nameKeywords": "iphone"}'>
</amp-ad>

<h2>mox</h2>
<amp-ad height="1"
type="mox"
data-z="1183"
data-w="720"
data-h="405">
</amp-ad>

<h2>myTarget</h2>
<amp-ad width="300" height="250"
type="mytarget"
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 @@ -293,6 +293,7 @@ See [amp-ad rules](https://github.com/ampproject/amphtml/blob/master/extensions/
- [MixiMedia](../../ads/miximedia.md)
- [Mixpo](../../ads/mixpo.md)
- [Monetizer101](../../ads/monetizer101.md)
- [mox](../../ads/mox.md)
- [myTarget](../../ads/mytarget.md)
- [myWidget](../../ads/mywidget.md)
- [Nativo](../../ads/nativo.md)
Expand Down