Skip to content

Commit

Permalink
Support AMP by CA ProFit-X (#3658)
Browse files Browse the repository at this point in the history
  • Loading branch information
watanabe yusaku authored and lannka committed Aug 10, 2016
1 parent 86a3ca1 commit b9a585b
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {adtech} from '../ads/adtech';
import {aduptech} from '../ads/aduptech';
import {amoad} from '../ads/amoad';
import {appnexus} from '../ads/appnexus';
import {caprofitx} from '../ads/caprofitx';
import {chargeads} from '../ads/chargeads';
import {colombia} from '../ads/colombia';
import {criteo} from '../ads/criteo';
Expand Down Expand Up @@ -92,6 +93,7 @@ import {yieldmo} from '../ads/yieldmo';
import {yieldone} from '../ads/yieldone';
import {zergnet} from '../ads/zergnet';


/**
* Whether the embed type may be used with amp-embed tag.
* @const {!Object<string, boolean>}
Expand All @@ -118,6 +120,7 @@ register('adtech', adtech);
register('aduptech', aduptech);
register('amoad', amoad);
register('appnexus', appnexus);
register('caprofitx', caprofitx);
register('chargeads', chargeads);
register('colombia', colombia);
register('criteo', criteo);
Expand Down
5 changes: 5 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const adPrefetch = {
aduptech: 'https://s.d.adup-tech.com/jsapi',
amoad: 'https://j.amoad.com/js/a.js',
appnexus: 'https://acdn.adnxs.com/ast/ast.js',
caprofitx: [
'https://cdn.caprofitx.com/pfx.min.js',
'https://cdn.caprofitx.com/tags/amp/profitx_amp.js',
],
colombia: 'https://static.clmbtech.com/ad/commons/js/colombia-amp.js',
criteo: 'https://static.criteo.net/js/ld/publishertag.js',
dotandads: 'https://amp.ad.dotandad.com/dotandadsAmp.js',
Expand Down Expand Up @@ -109,6 +113,7 @@ export const adPreconnect = {
'https://v.amoad.com',
],
appnexus: 'https://ib.adnxs.com',
caprofitx: 'https://ad.caprofitx.adtdp.com',
chargeads: [
'https://www.chargeplatform.com',
],
Expand Down
28 changes: 28 additions & 0 deletions ads/caprofitx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright 2015 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 {loadScript, checkData, validateDataExists} from '../3p/3p';
/**
* @param {!Window} global
* @param {!Object} data
*/
export function caprofitx(global, data) {
checkData(data, ['tagid']);
validateDataExists(data, ['tagid']);

global.caprofitxConfig = data;
loadScript(global, 'https://cdn.caprofitx.com/tags/amp/profitx_amp.js');
}
37 changes: 37 additions & 0 deletions ads/caprofitx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!---
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.
-->

# CA ProFit-X

## Example

```html
<amp-ad
width="320"
height="50"
type="caprofitx"
data-tagid="15217"
data-placeid="0"
>
</amp-ad>
```

## Configuration
For configuration in detail, [please contact us](ca_profitx_support@cyberagent.co.jp).

### parameters
- (Required) data-tagid
- (Option) data-placeid
1 change: 1 addition & 0 deletions builtins/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d
- [Ad Up Technology](../ads/aduptech.md)
- [AMoAd](../ads/amoad.md)
- [AppNexus](../ads/appnexus.md)
- [CA-ProFit-X](../ads/caprofitx.md)
- [Chargeads](../ads/chargeads.md)
- [Colombia](../ads/colombia.md)
- [Criteo](../ads/criteo.md)
Expand Down
11 changes: 11 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h2>Ad networks in <span class="broken">red color</span> have broken examples, p
<a href="#aduptech">Ad Up Technology</a> |
<a href="#amoad" class="broken">AMoAd</a> |
<a href="#appnexus">App Nexus</a> |
<a href="#caprofitx">CA ProFit X</a> |
<a href="#chargeads">Chargeads</a> |
<a href="#colombia" class="broken">Colombia ad</a> |
<a href="#criteo" class="broken">Criteo</a> |
Expand Down Expand Up @@ -217,6 +218,14 @@ <h2 id="appnexus">AppNexus with JSON based configuration multi ad</h2>
json='{"pageOpts":{"member": 958}, "adUnits": [{"disablePsa": true, "tagId": 6063968,"sizes": [300,250],"targetId": "apn_ad_1"}, {"tagId": 6063968,"sizes": [728,90],"targetId":"apn_ad_2"}]}'>
</amp-ad>

<h2 id="caprofitx">CA ProFit-X</h2>
<amp-ad
width="320"
height="50"
type="caprofitx"
data-tagid="17359">
</amp-ad>

<h2 id="chargeads">Chargeads</h2>
<amp-ad width="320" height="50"
type="chargeads"
Expand Down Expand Up @@ -643,5 +652,7 @@ <h2>YIELD ONE</h2>
data-pid="032478_4">
</amp-ad>


</amp-ad>
</body>
</html>

0 comments on commit b9a585b

Please sign in to comment.