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

✨ Add Empower to amp-ad networks #24949

Merged
merged 1 commit into from Oct 16, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -131,6 +131,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 @@ -401,6 +402,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 @@ -418,6 +418,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
merty marked this conversation as resolved.
Show resolved Hide resolved

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

### Optional parameters

* `data-category`: Category identifier provided by Empower.
12 changes: 10 additions & 2 deletions examples/ads.amp.html
Expand Up @@ -140,6 +140,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 @@ -437,7 +438,7 @@ <h2>Ad Generation</h2>
type="adgeneration"
data-id="10722">
</amp-ad>

<h2>AdGlare</h2>
<amp-ad width="300" height="250" layout="responsive"
type="adglare"
Expand Down Expand Up @@ -1090,6 +1091,13 @@ <h2>eADV</h2>
data-u="l0o0c0a8l%3Ahtos">
</amp-ad>

<h2>Empower</h2>
merty marked this conversation as resolved.
Show resolved Hide resolved
<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 Expand Up @@ -1942,7 +1950,7 @@ <h2>SmileWanted ad</h2>
type="smilewanted"
data-zone="1">
</amp-ad>

<h2>sogou ad</h2>
<amp-ad width="20" height="3"
type="sogouad"
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Expand Up @@ -298,6 +298,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