Skip to content

Commit

Permalink
✨ Add new amp-ad type for verizonmedia (#32776)
Browse files Browse the repository at this point in the history
* add verizonmedia ad type

* Update ads/vendors/verizonmedia.md

Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>

* Update verizonmedia.js

updated copyright too

* updates verizonmedia ad type as requested

* Update verizonmedia.js

suggested updates

* add to ads.extern.js

* prettify documentation

* prettify documentation

* prettify documentation

* prettify documentation

Co-authored-by: ed <ed.brandmark@verizonmedia.com>
Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 3, 2021
1 parent 3aa6c2c commit 13940cb
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 2 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -275,6 +275,7 @@ import {unruly} from '../ads/vendors/unruly';
import {uzou} from '../ads/vendors/uzou';
import {valuecommerce} from '../ads/vendors/valuecommerce';
import {vdoai} from '../ads/vendors/vdoai';
import {verizonmedia} from '../ads/vendors/verizonmedia';
import {videointelligence} from '../ads/vendors/videointelligence';
import {videonow} from '../ads/vendors/videonow';
import {viralize} from '../ads/vendors/viralize';
Expand Down Expand Up @@ -552,6 +553,7 @@ register('unruly', unruly);
register('uzou', uzou);
register('valuecommerce', valuecommerce);
register('vdoai', vdoai);
register('verizonmedia', verizonmedia);
register('videointelligence', videointelligence);
register('videonow', videonow);
register('viqeoplayer', viqeoplayer);
Expand Down
28 changes: 28 additions & 0 deletions 3p/vendors/verizonmedia.js
@@ -0,0 +1,28 @@
/**
* Copyright 2021 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.
*/

// src/polyfills.js must be the first import.
import '../polyfills';

import {draw3p, init} from '../integration-lib';
import {register} from '../3p';

import {verizonmedia} from '../../ads/vendors/verizonmedia';

init(window);
register('verizonmedia', verizonmedia);

window.draw3p = draw3p;
6 changes: 6 additions & 0 deletions ads/_config.js
Expand Up @@ -1235,6 +1235,12 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},

'verizonmedia': {
prefetch: 'https://jac.yahoosandbox.com/amp/jac.js',
preconnect: ['https://jill.fc.yahoo.com'],
renderStartImplemented: true,
},

'videointelligence': {
preconnect: 'https://s.vi-serve.com',
renderStartImplemented: true,
Expand Down
3 changes: 3 additions & 0 deletions ads/ads.extern.js
Expand Up @@ -684,6 +684,9 @@ data.slot.setVisibility;
data.slot.setTargeting;
data.slot.setExtraParameters;

// verizonmedia.js
window.jacData;

// webediads.js
var wads;
wads.init;
Expand Down
26 changes: 26 additions & 0 deletions ads/vendors/verizonmedia.js
@@ -0,0 +1,26 @@
/**
* Copyright 2021 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, writeScript} from '../../3p/3p';
/**
* @param {!Window} global
* @param {{config: string}} data
*/
export function verizonmedia(global, data) {
validateData(data, ['config']);
global.jacData = data;
writeScript(global, 'https://jac.yahoosandbox.com/amp/jac.js');
}
57 changes: 57 additions & 0 deletions ads/vendors/verizonmedia.md
@@ -0,0 +1,57 @@
<!---
Copyright 2021 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.
-->

# VerizonMedia

## Example

```html
<amp-ad
type="verizonmedia"
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 semantics of configuration, please see ad network documentation.

### Required Parameters:

`data-config` - Config for ad call

### Optional parameters:

`data-stylesheet` - stylesheet to use inside iframe

### Configuration Details

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"}
15 changes: 13 additions & 2 deletions examples/amp-ad/ads.amp.html
Expand Up @@ -291,6 +291,7 @@
<option>uzou</option>
<option>valuecommerce</option>
<option>vdo.ai</option>
<option>verizonmedia</option>
<option>videointelligence</option>
<option>videonow</option>
<option>viralize</option>
Expand Down Expand Up @@ -643,7 +644,7 @@ <h2>Adpushup</h2>
data-slotpath="/103512698/AMP_COMPONENT_TEST_1"
data-totalAmpSlots="1">
</amp-ad>

<h2>AdReactor</h2>
<amp-ad width="728" height="90"
type="adreactor"
Expand Down Expand Up @@ -2669,7 +2670,17 @@ <h2>VDO.AI</h2>
>
</amp-ad>

<h2>Video intelligence</h2>
<h2>VerizonMedia</h2>
<amp-ad
type="verizonmedia"
data-config='{"adServer":{"1AS":{"region":"US"}},"positions":{"FB":{"alias":"93426461","sizes":["320x50"]}}}'
data-stylesheet="https://scdn.uc.atwola.com/ads/adsWrapper010121/styles.css"
width="320"
height="50"
>
</amp-ad>

<h2>Video intelligence</h2>
<amp-ad width="500" height="400"
type="videointelligence"
layout="responsive"
Expand Down

0 comments on commit 13940cb

Please sign in to comment.