Skip to content

Commit

Permalink
✨ Geozo: new ad vendor (#38251)
Browse files Browse the repository at this point in the history
* Geozo AMP integration

* Fix test

* Remove legacy

* Fixes by review

* Remove 'geozo' registration from 3p/integrations
  • Loading branch information
proxeter authored Jul 28, 2022
1 parent b73520d commit 5e3f3ee
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 3p/vendors/geozo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// src/polyfills.js must be the first import.
import '#3p/polyfills';

import {register} from '#3p/3p';
import {draw3p, init} from '#3p/integration-lib';

import {geozo} from '#ads/vendors/geozo';

init(window);
register('geozo', geozo);

window.draw3p = draw3p;
4 changes: 4 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ const adConfig = jsonConfiguration({
prefetch: 'https://js.gsspcln.jp/l/amp.js',
},

'geozo': {
renderStartImplemented: true,
},

'giraff': {
renderStartImplemented: true,
},
Expand Down
22 changes: 22 additions & 0 deletions ads/vendors/geozo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {loadScript, validateData} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function geozo(global, data) {
validateData(data, ['src', 'gzBlock']);
const {src} = data;
createContainer(global, data);
loadScript(global, src);
}

/**
* @param {!Window} global
* @param {!Object} data
*/
function createContainer(global, data) {
const d = global.document.createElement('div');
d.setAttribute('data-gz-block', data['gzBlock']);
global.document.getElementById('c').appendChild(d);
}
22 changes: 22 additions & 0 deletions ads/vendors/geozo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Geozo

Provides support for [Geozo](https://geozo.com) widgets.

### Required parameters

- `src`
- `data-gz-block`

## Example

```html
<amp-ad
layout="responsive"
width="320"
height="461"
type="geozo"
data-gz-block="dfb39dd6-66e0-4799-97e3-b7f3b23f5d17"
src="https://grvclf.com/3yi7l1/921vlip0m03y/hq8786/uqv876pkypn.go"
>
</amp-ad>
```
7 changes: 7 additions & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
<option>freewheel</option>
<option>fusion</option>
<option>genieessp</option>
<option>geozo</option>
<option>giraff</option>
<option>glomex</option>
<option>gmossp</option>
Expand Down Expand Up @@ -1312,6 +1313,12 @@ <h2>Geniee SSP</h2>
<amp-ad width="300" height="250" type="genieessp" data-vid="3" data-zid="1077330">
</amp-ad>

<h2>Geozo</h2>
<amp-ad layout="responsive" width="320" height="461" type="geozo"
data-gz-block="dfb39dd6-66e0-4799-97e3-b7f3b23f5d17"
src="https://grvclf.com/3yi7l1/921vlip0m03y/hq8786/uqv876pkypn.go">
</amp-ad>

<h2>Giraff</h2>
<amp-ad width="300" height="480" type="giraff" data-block-name="novotekaru">
</amp-ad>
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ See [amp-ad rules](validator-amp-ad.protoascii) in the AMP validator specificati
- [FreeWheel](../../ads/vendors/freewheel.md)
- [Fusion](../../ads/vendors/fusion.md)
- [GenieeSSP](../../ads/vendors/genieessp.md)
- [Geozo](../../ads/vendors/geozo.md)
- [Giraff](../../ads/vendors/giraff.md)
- [Glomex](../../ads/vendors/glomex.md)
- [GMOSSP](../../ads/vendors/gmossp.md)
Expand Down

0 comments on commit 5e3f3ee

Please sign in to comment.