Skip to content

Commit

Permalink
GMOSSP amp-ad support (#2814)
Browse files Browse the repository at this point in the history
* GMOSSP amp-ad support

* Update license year and add checkData, validateDataExists
  • Loading branch information
HikaruYokogoshi authored and dvoytenko committed Apr 7, 2016
1 parent 8e744a4 commit e1ddb45
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -58,6 +58,7 @@ import {rubicon} from '../ads/rubicon';
import {imobile} from '../ads/imobile';
import {webediads} from '../ads/webediads';
import {user} from '../src/log';
import {gmossp} from '../ads/gmossp';

/**
* Whether the embed type may be used with amp-embed tag.
Expand Down Expand Up @@ -99,6 +100,7 @@ register('teads', teads);
register('rubicon', rubicon);
register('imobile', imobile);
register('webediads', webediads);
register('gmossp', gmossp);

// For backward compat, we always allow these types without the iframe
// opting in.
Expand Down
2 changes: 2 additions & 0 deletions ads/_config.js
Expand Up @@ -40,6 +40,7 @@ export const adPrefetch = {
teads: 'https://cdn.teads.tv/media/format/v3/teads-format.min.js',
imobile: 'https://spamp.i-mobile.co.jp/script/amp.js',
sortable: 'https://www.googletagservices.com/tag/js/gpt.js',
gmossp: 'https://cdn.gmossp-sp.jp/ads/amp.js',
};

/**
Expand Down Expand Up @@ -117,6 +118,7 @@ export const adPreconnect = {
webediads: [
'https://eu1.wbdds.com',
],
gmossp: 'https://cdn.gmossp-sp.jp',
};

/**
Expand Down
31 changes: 31 additions & 0 deletions ads/gmossp.js
@@ -0,0 +1,31 @@
/**
* 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, checkData, validateDataExists} from '../src/3p';

const gmosspFields = ['width', 'height', 'id'];

/**
* @param {!Window} global
* @param {!Object} data
*/
export function gmossp(global, data) {
checkData(data, gmosspFields);
validateDataExists(data, gmosspFields);

global.gmosspParam = data;
writeScript(global, 'https://cdn.gmossp-sp.jp/ads/amp.js');
}
37 changes: 37 additions & 0 deletions ads/gmossp.md
@@ -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.
-->

# GMOSSP

## Example

```html
<amp-ad
width="320"
height="50"
type="gmossp"
data-id="20175"
>
</amp-ad>
```

## Configuration

For configuration details and to generate your tags, please contact dev@ml.gmo-am.jp

Supported parameters:

- data-id
1 change: 1 addition & 0 deletions builtins/amp-ad.md
Expand Up @@ -78,6 +78,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d
- [Teads](../ads/teads.md)
- [I-Mobile](../ads/imobile.md)
- [Webediads](../ads/webediads.md)
- [GMOSSP](../ads/gmossp.md)

## Styling

Expand Down
7 changes: 7 additions & 0 deletions examples/ads.amp.html
Expand Up @@ -323,5 +323,12 @@ <h2>I-Mobile 320x50 banner</h2>
data-asid="813689">
</amp-ad>

<h2>GMOSSP 320x50 banner</h2>
<amp-ad width="320"
height="50"
type="gmossp"
data-id="10014">
</amp-ad>

</body>
</html>
1 change: 1 addition & 0 deletions test/functional/test-integration.js
Expand Up @@ -51,6 +51,7 @@ describe('3p integration.js', () => {
expect(registrations).to.include.key('triplelift');
expect(registrations).to.include.key('_ping_');
expect(registrations).to.include.key('imobile');
expect(registrations).to.include.key('gmossp');
});

it('should validateParentOrigin without ancestorOrigins', () => {
Expand Down

0 comments on commit e1ddb45

Please sign in to comment.