Skip to content

Commit

Permalink
AMP integration with Holder (ampproject#6024)
Browse files Browse the repository at this point in the history
* Draft w/o lib

Draft w/o lib

* Fix

* Trying to setup local dev
Signed-off-by: Anton Ornatskyi <[email protected]>

* Draft

Signed-off-by: Anton Ornatskyi <[email protected]>

* preconnect

Signed-off-by: Anton Ornatskyi <[email protected]>

* Dropbox

Signed-off-by: Anton Ornatskyi <[email protected]>

* config

Signed-off-by: Anton Ornatskyi <[email protected]>

* Worked simple version

Lint checked
Banner received

* holderamp lib v1

Signed-off-by: Anton Ornatskyi <[email protected]>

* First PR candidate

* Final, ready to PR

* Draft w/o lib

Draft w/o lib

* Fix

* Trying to setup local dev
Signed-off-by: Anton Ornatskyi <[email protected]>

* Draft

Signed-off-by: Anton Ornatskyi <[email protected]>

* Dropbox

Signed-off-by: Anton Ornatskyi <[email protected]>

* config

Signed-off-by: Anton Ornatskyi <[email protected]>

* Worked simple version

Lint checked
Banner received

* holderamp lib v1

Signed-off-by: Anton Ornatskyi <[email protected]>

* First PR candidate

* Final, ready to PR

* Final, ready to PR

* Draft w/o lib

Final version, ready to PR

* Final version, ready for PR

* holderamp lib v1

Signed-off-by: Anton Ornatskyi <[email protected]>

* PR candidate

* Final, ready to PR

* Final ready to PR

* Cookie request removed

* var document - removed

* Syntax fixes

* ampSlotIndex removed
  • Loading branch information
AntonOrnatskyi authored and lannka committed Nov 9, 2016
1 parent 42825ff commit 67a27d0
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 3p/integration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -71,6 +71,7 @@ import {eplanning} from '../ads/eplanning';
import {flite} from '../ads/flite';
import {genieessp} from '../ads/genieessp';
import {gmossp} from '../ads/gmossp';
import {holder} from '../ads/holder';
import {ibillboard} from '../ads/ibillboard';
import {imobile} from '../ads/imobile';
import {improvedigital} from '../ads/improvedigital';
Expand Down Expand Up @@ -176,6 +177,7 @@ register('facebook', facebook);
register('flite', flite);
register('genieessp', genieessp);
register('gmossp', gmossp);
register('holder', holder);
register('ibillboard', ibillboard);
register('imobile', imobile);
register('improvedigital', improvedigital);
Expand Down
6 changes: 6 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ export const adConfig = {
prefetch: 'https://cdn.gmossp-sp.jp/ads/amp.js',
},

holder: {
prefetch: 'https://i.holder.com.ua/js2/holder/ajax/ampv1.js',
preconnect: 'https://h.holder.com.ua',
renderStartImplemented: true,
},

ibillboard: {},

imobile: {
Expand Down
33 changes: 33 additions & 0 deletions ads/holder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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 {writeScript, validateData} from '../3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function holder(global, data) {
validateData(data, ['block'], []);
const wcl = global.context.location;
const n = navigator.userAgent;
let l = '&r' + Math.round((Math.random() * 10000000)) + '&h' + wcl.href;
if (!(n.indexOf('Safari') != -1 && n.indexOf('Chrome') == -1)) {
l += '&c1';
}
data.queue = l;
writeScript(global,'https://i.holder.com.ua/js2/holder/ajax/ampv1.js');
}
37 changes: 37 additions & 0 deletions ads/holder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!---
Copyright 2015 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.
-->

# Holder

## Example

```html
<amp-ad
width="300"
height="250"
type="holder"
data-block="1847"
>
</amp-ad>
```

## Configuration

For configuration details and to generate your tags, please contact [email protected]

Supported parameters:

- data-block
9 changes: 9 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ <h2>Ad networks in <span class="broken">red color</span> have broken examples, p
<a href="#flite">Flite</a> |
<a href="#genieessp"></a> |
<a href="#gmossp" class="broken"></a> |
<a href="#holder">Holder</a> |
<a href="#ibillboard">iBILLBOARD</a> |
<a href="#imobile">I-Mobile</a> |
<a href="#industrybrains">Industrybrains</a> |
Expand Down Expand Up @@ -583,6 +584,14 @@ <h2 id="gmossp" class="broken">GMOSSP 320x50 banner</h2>
<div fallback></div>
</amp-ad>

<h2 id="holder">Holder 300x250 banner</h2>
<amp-ad width="300" height="250"
type="holder"
data-block="7163">
<div placeholder></div>
<div fallback></div>
</amp-ad>

<h2 id="ibillboard">iBillboard 300x250 banner</h2>
<amp-ad width="300" height="250"
type="ibillboard"
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 @@ -111,6 +111,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d
- [Flite](../../ads/flite.md)
- [GenieeSSP](../../ads/genieessp.md)
- [GMOSSP](../../ads/gmossp.md)
- [Holder](../../ads/holder.md)
- [I-Mobile](../../ads/imobile.md)
- [iBillboard](../../ads/ibillboard.md)
- [Improve Digital](../../ads/improvedigital.md)
Expand Down

0 comments on commit 67a27d0

Please sign in to comment.