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

♻️ Verizon media yahoo components merge #35797

Merged
merged 2 commits into from
Aug 26, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ads/vendors/yahoo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import {validateData, writeScript} from '#3p/3p';
* @param {!Object} data
*/
export function yahoo(global, data) {
validateData(data, ['sid', 'site', 'sa']);
global.yadData = data;
writeScript(global, 'https://s.yimg.com/aaq/ampad/display.js');
if (data.sid) {
validateData(data, ['sid', 'site', 'sa']);
global.yadData = data;
writeScript(global, 'https://s.yimg.com/aaq/ampad/display.js');
} else if (data.config) {
validateData(data, ['config']);
global.jacData = data;
writeScript(global, 'https://jac.yahoosandbox.com/amp/jac.js');
}
}
37 changes: 37 additions & 0 deletions ads/vendors/yahoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
</amp-ad>
```

```html
<amp-ad
type="yahoo"
width="300"
height="250"
data-config='{"adServer":{"1AS":{"region":"US"}},
"positions":{"FB":{"alias":"1111111","sizes":["300x250"]}},
"site":{name:{"autoblogAMP"}},"spaceId":"111111"}'
data-stylesheet="https://www.autoblog.com/static/styles.css"
>
</amp-ad>
```

### Configuration

For configuration details, please contact https://advertising.yahoo.com/contact.
Expand All @@ -25,3 +38,27 @@ Supported parameters:
- `data-sid`
- `data-site`
- `data-sa`
- `data-config`
- `data-stylesheet`

### Required Parameters:

`data-config` - Config for ad call JAC
`data-sa` - Config for ad call DARLA

### Optional parameters:

`data-stylesheet` - stylesheet to use inside iframe
Copy link
Contributor

Choose a reason for hiding this comment

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

This all seems good to me, but @powerivq do we allow arbitrary stylesheet insertion in this manner elsewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't seen any, but since it all happens in an iframe, I am not worried

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that supported by the original verizonmedia.js component which is just being merged into the yahoo.js this PR.


### Configuration Details

For JAC ads : Required
"adServer":{"1AS":{region":"US"}},
"positions":{"FB":{alias:"1111111"},"sizes":["300x250"]}},
"site":{name:{"autoblogAMP"}},"spaceId":"111111"}

Alias, Sizes, SiteName and spaceId should be replaced by correct values.
NOTE: SiteName should be site name + "AMP"

Optional
"params":{"name":"value"}