Skip to content

Commit

Permalink
Add Empower to amp-ad networks (#24949)
Browse files Browse the repository at this point in the history
  • Loading branch information
merty authored and calebcordry committed Oct 16, 2019
1 parent 502aba7 commit 3e6457f
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -132,6 +132,7 @@ import {dotandads} from '../ads/dotandads';
import {dynad} from '../ads/dynad';
import {eadv} from '../ads/eadv';
import {eas} from '../ads/eas';
import {empower} from '../ads/empower';
import {engageya} from '../ads/engageya';
import {epeex} from '../ads/epeex';
import {eplanning} from '../ads/eplanning';
Expand Down Expand Up @@ -407,6 +408,7 @@ register('dynad', dynad);
register('eadv', eadv);
register('eas', eas);
register('embedly', embedly);
register('empower', empower);
register('engageya', engageya);
register('epeex', epeex);
register('eplanning', eplanning);
Expand Down
5 changes: 5 additions & 0 deletions ads/_config.js
Expand Up @@ -422,6 +422,11 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},

'empower': {
prefetch: 'https://cdn.empower.net/sdk/amp-ad.min.js',
renderStartImplemented: true,
},

'engageya': {},

'epeex': {},
Expand Down
5 changes: 5 additions & 0 deletions ads/ads.extern.js
Expand Up @@ -377,6 +377,11 @@ data.zone;
// distroscale.js
data.tid;

// empower.js
data.category;
data.site;
data.zone;

// eplanning.js
data.epl_si;
data.epl_isv;
Expand Down
31 changes: 31 additions & 0 deletions ads/empower.js
@@ -0,0 +1,31 @@
/**
* Copyright 2019 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 {!Object} data
*/
export function empower(global, data) {
validateData(data, ['site', 'zone'], ['category']);
global.category = data.category || 'general';
global.site = data.site + ':general';
global.zone = data.zone;
global.iwidth = data.width;
global.iheight = data.height;
writeScript(global, 'https://cdn.empower.net/sdk/amp-ad.min.js');
}
43 changes: 43 additions & 0 deletions ads/empower.md
@@ -0,0 +1,43 @@
<!---
Copyright 2019 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.
-->

# Empower

## Example

```html
<amp-ad width="300" height="250"
type="empower"
data-site="example"
data-zone="123456">
<div placeholder></div>
<div fallback></div>
</amp-ad>
```


## Configuration

For details on the configuration semantics, please contact the ad network or refer to their documentation.

### Required parameters

* `data-site`: Site identifier provided by Empower.
* `data-zone`: Zone ID of the ad space.

### Optional parameters

* `data-category`: Category identifier provided by Empower.
8 changes: 8 additions & 0 deletions examples/ads.amp.html
Expand Up @@ -141,6 +141,7 @@
<option>dynad</option>
<option>eadv</option>
<option>eas</option>
<option>empower</option>
<option>Engageya</option>
<option>epeex</option>
<option>eplanning</option>
Expand Down Expand Up @@ -1107,6 +1108,13 @@ <h2>eADV</h2>
data-u="l0o0c0a8l%3Ahtos">
</amp-ad>

<h2>Empower</h2>
<amp-ad width="300" height="250"
type="empower"
data-site="example"
data-zone="123456">
</amp-ad>

<h2>Engageya widget</h2>
<amp-embed width="200" height="200"
type="engageya"
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Expand Up @@ -299,6 +299,7 @@ See [amp-ad rules](https://github.com/ampproject/amphtml/blob/master/extensions/
- [DynAd](../../ads/dynad.md)
- [eADV](../../ads/eadv.md)
- [E-Planning](../../ads/eplanning.md)
- [Empower](../../ads/empower.md)
- [Ezoic](../../ads/ezoic.md)
- [Felmat](../../ads/felmat.md)
- [FlexOneELEPHANT](../../ads/f1e.md)
Expand Down
8 changes: 8 additions & 0 deletions validator/testdata/feature_tests/ads.html
Expand Up @@ -123,6 +123,7 @@
<option>distroscale</option>
<option>dotandads</option>
<option>doubleclick</option>
<option>empower</option>
<option>eplanning</option>
<option>ezoic</option>
<option>f1e</option>
Expand Down Expand Up @@ -682,6 +683,13 @@ <h2>E-Planning 320x50</h2>
data-epl_e="AMP_TEST">
</amp-ad>

<h2>Empower</h2>
<amp-ad width="300" height="250"
type="empower"
data-site="example"
data-zone="123456">
</amp-ad>

<h2>Ezoic</h2>
<amp-ad width="300" height="250"
type="ezoic"
Expand Down
8 changes: 8 additions & 0 deletions validator/testdata/feature_tests/ads.out
Expand Up @@ -124,6 +124,7 @@ PASS
| <option>distroscale</option>
| <option>dotandads</option>
| <option>doubleclick</option>
| <option>empower</option>
| <option>eplanning</option>
| <option>ezoic</option>
| <option>f1e</option>
Expand Down Expand Up @@ -683,6 +684,13 @@ PASS
| data-epl_e="AMP_TEST">
| </amp-ad>
|
| <h2>Empower</h2>
| <amp-ad width="300" height="250"
| type="empower"
| data-site="example"
| data-zone="123456">
| </amp-ad>
|
| <h2>Ezoic</h2>
| <amp-ad width="300" height="250"
| type="ezoic"
Expand Down

0 comments on commit 3e6457f

Please sign in to comment.