Skip to content

Commit

Permalink
request for integrating adman ad-server
Browse files Browse the repository at this point in the history
add adman to builtins/amp-ad.md and check for required attributes

update adman.md documentation

adman.js use global
  • Loading branch information
anmarkom committed Apr 7, 2016
1 parent d39f7e3 commit dca108b
Show file tree
Hide file tree
Showing 5 changed files with 87 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 @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
38 changes: 38 additions & 0 deletions ads/adman.js
Original file line number Diff line number Diff line change
@@ -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);
}
38 changes: 38 additions & 0 deletions ads/adman.md
Original file line number Diff line number Diff line change
@@ -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.
-->

# Adman

## Example

```html
<amp-ad width="300" height="250"
type="adman"
data-ws="17342"
data-s="300x250"
data-host="talos.adman.gr">
</amp-ad>
```

## 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
1 change: 1 addition & 0 deletions builtins/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ <h2>Adblade</h2>
data-height="250"
data-cid="19626-3798936394">
</amp-ad>
<h2>Adman</h2>

<amp-ad width="300" height="250"
type="adman"
data-ws="17342"
data-s="300x250"
data-host="talos.adman.gr">
</amp-ad>

<h2>AdReactor</h2>
<amp-ad width=728 height=90
Expand Down

0 comments on commit dca108b

Please sign in to comment.