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

Yahoo amp-ad plugin #5122

Closed
wants to merge 2 commits into from
Closed
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 @@ -102,6 +102,7 @@ import {triplelift} from '../ads/triplelift';
import {webediads} from '../ads/webediads';
import {weboramaDisplay} from '../ads/weborama';
import {widespace} from '../ads/widespace';
import {yahoo} from '../ads/yahoo';
import {yahoojp} from '../ads/yahoojp';
import {yieldbot} from '../ads/yieldbot';
import {yieldmo} from '../ads/yieldmo';
Expand Down Expand Up @@ -200,6 +201,7 @@ register('twitter', twitter);
register('webediads', webediads);
register('weborama-display', weboramaDisplay);
register('widespace', widespace);
register('yahoo', yahoo);
register('yahoojp', yahoojp);
register('yieldbot', yieldbot);
register('yieldmo', yieldmo);
Expand Down
5 changes: 5 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ export const adConfig = {

widespace: {},

yahoo: {
prefetch: 'https://s.yimg.com/os/ampad/display.js',
preconnect: 'https://us.adserver.yahoo.com',
},

yahoojp: {
prefetch: [
'https://s.yimg.jp/images/listing/tool/yads/ydn/amp/amp.js',
Expand Down
28 changes: 28 additions & 0 deletions ads/yahoo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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 {validateData, loadScript} from '../3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move the JS doc to the right place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went ahead and restructured this code a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

export function yahoo(global, data) {
validateData(data, ['sid', 'site', 'sa']);
loadScript(global, 'https://s.yimg.com/os/ampad/display.js', function () {
window.ampAdExecute(global, data);
});
}
42 changes: 42 additions & 0 deletions ads/yahoo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!---
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.
-->

# yahoo

## Display

```html
<amp-ad
type="yahoo"
width="316"
height="264"
data-sid="954014446"
data-site="news"
data-sa='{"LREC":"300x250","secure":"true","content":"no_expandable;"}'>
</amp-ad>
```

### Configuration

For configuration details, please contact https://advertising.yahoo.com/contact

Supported parameters:

- height
- width
- data-sid
- data-site
- data-sa
11 changes: 11 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ <h2>Ad networks in <span class="broken">red color</span> have broken examples, p
<a href="#webediads">Webediads</a> |
<a href="#weborama">Weborama</a> |
<a href="#widespace">Widespace</a> |
<a href="#yahoo">Yahoo</a> |
<a href="#yahoojp">YahooJP</a> |
<a href="#yieldbot">Yieldbot</a> |
<a href="#yieldone">Yield One</a> |
Expand Down Expand Up @@ -926,6 +927,16 @@ <h2>Widespace 300x300 no-ad fallback</h2>
<div fallback></div>
</amp-ad>

<h2 id="yahoo">Yahoo Display</h2>
<amp-ad width="316" height="264"
type="yahoo"
data-sid="954014446"
data-site="news"
data-sa='{"LREC":"300x250","secure":"true","content":"no_expandable;"}'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add the following tags inside amp-ad

    <div placeholder></div>
    <div fallback></div>

<div placeholder></div>
<div fallback></div>
</amp-ad>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add an example for adtype=gemini

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


<h2 id="yahoojp">YahooJP YDN</h2>
<amp-ad width="300" height="250"
type="yahoojp"
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 @@ -143,6 +143,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d
- [Webediads](../../ads/webediads.md)
- [Weborama](../../ads/weborama.md)
- [Widespace](../../ads/widespace.md)
- [Yahoo](../ads/yahoo.md)
- [YahooJP](../../ads/yahoojp.md)
- [Yieldbot](../../ads/yieldbot.md)
- [Yieldmo](../../ads/yieldmo.md)
Expand Down