admanmedia ad network type added#8052
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
It seems CI build failed but I cannot see a relation with my changes. Please confirm and let me know which would be the solution. Thanks in advance! |
|
This is for the AdMan Media company http://admanmedia.com/ |
|
Hello, Is any news about this pull request? Thanks in advance |
ads/_config.js
Outdated
|
|
||
| adman: {}, | ||
|
|
||
| admanmedia: {}, |
There was a problem hiding this comment.
We have a render-start API that helps to provide better user experience. Please consider implementing it. Please let me know if there's any questions. doc
ads/admanmedia.js
Outdated
| @@ -0,0 +1,32 @@ | |||
| /** | |||
| * Copyright 2016 The AMP HTML Authors. All Rights Reserved. | |||
ads/admanmedia.js
Outdated
| * @param {!Object} data | ||
| */ | ||
| export function admanmedia(global, data) { | ||
| validateData(data, ['id'], []); |
There was a problem hiding this comment.
third param is optional. No need to specify.
ads/admanmedia.md
Outdated
| @@ -0,0 +1,32 @@ | |||
| <!--- | |||
| Copyright 2016 The AMP HTML Authors. All Rights Reserved. | |||
ads/admanmedia.js
Outdated
| export function admanmedia(global, data) { | ||
| validateData(data, ['id'], []); | ||
|
|
||
| const script = global.document.createElement('script'); |
There was a problem hiding this comment.
Please refer to writeScript which is sync or loadScript which is async.
examples/ads.amp.html
Outdated
|
|
||
| <h2 id="admanmedia">AdmanMedia</h2> | ||
| <amp-ad width="300" height="250" | ||
| type="admanmedia" |
There was a problem hiding this comment.
I'm not able to see a rendered example. Could you please check that the example ad is rendering?
|
Hello @zhouyx , we have just uploaded our changes. Could you please review and let us know if everything is ok? |
ads/admanmedia.md
Outdated
| <amp-ad width="300" height="250" | ||
| type="admanmedia" | ||
| data-id="8e916419"> | ||
| </amp-ad> |
ads/admanmedia.js
Outdated
| export function admanmedia(global, data) { | ||
| validateData(data, ['id']); | ||
|
|
||
| loadScript(global, `https://mona.admanmedia.com/go?id=${data.id}`, () => { |
There was a problem hiding this comment.
please use encodeURIComponent(data.id)
| </amp-ad> | ||
|
|
||
| <h2>AdmanMedia</h2> | ||
| <amp-ad width="300" height="250" |
There was a problem hiding this comment.
When testing locally, as the mona.admanmedia.com does not set specially CORS headers for localhost, I am launching Chrome like this: ./chrome --disable-web-security --user-data-dir
Prior to launching it to production we will setup CORS headers on our server and this error will not be launched anymore
There was a problem hiding this comment.
Cool I am able to see it now. After this PR has been merged it usually takes two weeks for it to hit prod. It's usually towards the end of a week, but not always on an exact data. Is there a concern why you can't setup the header a bit earlier?
There was a problem hiding this comment.
Thanks for you valuable remarks that helped us improve the code quality. We have started the internal process for CORS header setting and hopefully in a few days we will be all set.
ads/admanmedia.js
Outdated
|
|
||
| const encodedId = encodeURIComponent(data.id); | ||
| loadScript(global, `https://mona.admanmedia.com/go?id=${encodedId}`, () => { | ||
| const pattern = `script[src$="id=${data.id}"]`; |
|
Look good in general. Few minor requests. |
|
LGTM. Thanks for the Pull Request. Merged. |

AdMan Media ad network type implementation