Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Affiliate-B support for amp-ad (#5223)
  • Loading branch information
For-it-inc authored and zhouyx committed Oct 7, 2016
1 parent f28e116 commit 686bbef
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -52,6 +52,7 @@ import {adspirit} from '../ads/adspirit';
import {adstir} from '../ads/adstir';
import {adtech} from '../ads/adtech';
import {aduptech} from '../ads/aduptech';
import {affiliateb} from '../ads/affiliateb';
import {amoad} from '../ads/amoad';
import {appnexus} from '../ads/appnexus';
import {atomx} from '../ads/atomx';
Expand Down Expand Up @@ -142,6 +143,7 @@ register('adspirit', adspirit);
register('adstir', adstir);
register('adtech', adtech);
register('aduptech', aduptech);
register('affiliateb', affiliateb);
register('amoad', amoad);
register('appnexus', appnexus);
register('atomx', atomx);
Expand Down
5 changes: 5 additions & 0 deletions ads/_config.js
Expand Up @@ -98,6 +98,11 @@ export const adConfig = {
prefetch: 'https://s.d.adup-tech.com/jsapi',
},

affiliateb: {
prefetch: 'https://track.affiliate-b.com/amp/a.js',
renderStartImplemented: true,
},

amoad: {
prefetch: [
'https://j.amoad.com/js/a.js',
Expand Down
27 changes: 27 additions & 0 deletions ads/affiliateb.js
@@ -0,0 +1,27 @@
/**
* 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 {writeScript, validateData} from '../3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function affiliateb(global, data) {
validateData(data, ['afb_a', 'afb_p', 'afb_t']);
global.afbParam = data;
writeScript(global, 'https://track.affiliate-b.com/amp/a.js');
}
36 changes: 36 additions & 0 deletions ads/affiliateb.md
@@ -0,0 +1,36 @@
<!---
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.
-->

# AffiliateB

## Example

```html
<amp-ad width=300 height=250
type="affiliateb"
data-afb_a="l44x-y174897c"
data-afb_p="g2m"
data-afb_t="i">
</amp-ad>
```

## Configuration

For configuration details and to generate your tags, please contact https://www.affiliate-b.com/web/contact/form.php

Supported parameters:

- data-nend_params
11 changes: 11 additions & 0 deletions examples/ads.amp.html
Expand Up @@ -90,6 +90,7 @@ <h2>Ad networks in <span class="broken">red color</span> have broken examples, p
<a href="#adstir">AdStir</a> |
<a href="#adtech">AdTech</a> |
<a href="#aduptech">Ad Up Technology</a> |
<a href="#affiliateb">Affiliate-B</a> |
<a href="#amoad">AMoAd</a> |
<a href="#appnexus">App Nexus</a> |
<a href="#atomx">Atomx</a> |
Expand Down Expand Up @@ -277,6 +278,16 @@ <h2 id="aduptech">Ad Up Technology</h2>
<div fallback></div>
</amp-ad>

<h2 id="affiliateb">Affiliate-B</h2>
<amp-ad width=300 height=250
type="affiliateb"
data-afb_a="l44x-y174897c"
data-afb_p="g2m"
data-afb_t="i">
<div placeholder></div>
<div fallback></div>
</amp-ad>

<h2 id="amoad">AMoAd banner</h2>
<amp-ad width="300" height="250"
type="amoad"
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Expand Up @@ -93,6 +93,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d
- [AdStir](../../ads/adstir.md)
- [AdTech](../../ads/adtech.md)
- [Ad Up Technology](../../ads/aduptech.md)
- [Affiliate-B](../../ads/affiliateb.md)
- [AMoAd](../../ads/amoad.md)
- [AppNexus](../../ads/appnexus.md)
- [Atomx](../../ads/atomx.md)
Expand Down

0 comments on commit 686bbef

Please sign in to comment.