From dca108bf80120bebe739e8cbc7b10107dab177b6 Mon Sep 17 00:00:00 2001 From: Anna Markomanolaki Date: Tue, 29 Mar 2016 14:24:22 +0300 Subject: [PATCH] request for integrating adman ad-server add adman to builtins/amp-ad.md and check for required attributes update adman.md documentation adman.js use global --- 3p/integration.js | 2 ++ ads/adman.js | 38 ++++++++++++++++++++++++++++++++++++++ ads/adman.md | 38 ++++++++++++++++++++++++++++++++++++++ builtins/amp-ad.md | 1 + examples/ads.amp.html | 8 ++++++++ 5 files changed, 87 insertions(+) create mode 100644 ads/adman.js create mode 100644 ads/adman.md diff --git a/3p/integration.js b/3p/integration.js index fa539019c3bc..38142661752b 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -27,6 +27,7 @@ import {installEmbedStateListener} from './environment'; import {a9} from '../ads/a9'; import {adblade, industrybrains} from '../ads/adblade'; import {adform} from '../ads/adform'; +import {adman} from '../ads/adman'; import {adreactor} from '../ads/adreactor'; import {adsense} from '../ads/google/adsense'; import {adtech} from '../ads/adtech'; @@ -69,6 +70,7 @@ const AMP_EMBED_ALLOWED = { register('a9', a9); register('adblade', adblade); register('adform', adform); +register('adman', adman); register('adreactor', adreactor); register('adsense', adsense); register('adtech', adtech); diff --git a/ads/adman.js b/ads/adman.js new file mode 100644 index 000000000000..ca48056cbc30 --- /dev/null +++ b/ads/adman.js @@ -0,0 +1,38 @@ +/** + * Copyright 2016 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 {checkData, validateDataExists} from '../src/3p'; + +/** + * @param {!Window} global + * @param {!Object} data + */ +export function adman(global, data) { + const script = global.document.createElement('script'); + const fields = ['ws', 'host', 's']; + + checkData(data, fields); + validateDataExists(data, fields); + + script.setAttribute('data-ws', data.ws); + script.setAttribute('data-h', data.host); + script.setAttribute('data-s', data.s); + script.setAttribute('data-tech', 'amp'); + + script.src = 'https://static.adman.gr/adman.js'; + + global.document.body.appendChild(script); +} diff --git a/ads/adman.md b/ads/adman.md new file mode 100644 index 000000000000..cbfa6d77332d --- /dev/null +++ b/ads/adman.md @@ -0,0 +1,38 @@ + + +# Adman + +## Example + +```html + + +``` + +## Configuration + +For semantics of configuration, please see Adman [documentation](http://www.adman.gr/docs). + +__Required:__ + +- `data-ws` - Adunit unique id +- `data-s` - Adunit size +- `data-host` - SSL enabled Adman service domain diff --git a/builtins/amp-ad.md b/builtins/amp-ad.md index 184df2047431..a68ce3506b4c 100644 --- a/builtins/amp-ad.md +++ b/builtins/amp-ad.md @@ -57,6 +57,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d - [A9](../ads/a9.md) - [Adblade](../ads/adblade.md) - [Adform](../ads/adform.md) +- [Adman](../ads/adman.md) - [AdReactor](../ads/adreactor.md) - [AdSense](../ads/google/adsense.md) - [AdTech](../ads/adtech.md) diff --git a/examples/ads.amp.html b/examples/ads.amp.html index 7da11b63a88c..601ce7e5d4bb 100644 --- a/examples/ads.amp.html +++ b/examples/ads.amp.html @@ -56,6 +56,14 @@

Adblade

data-height="250" data-cid="19626-3798936394"> +

Adman

+ + +

AdReactor