New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
@@ -75,6 +75,8 @@ export const adConfig = { | |||
|
|||
adman: {}, | |||
|
|||
admanmedia: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
ads/admanmedia.js
Outdated
* @param {!Object} data | ||
*/ | ||
export function admanmedia(global, data) { | ||
validateData(data, ['id'], []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to writeScript
which is sync or loadScript
which is async.
examples/ads.amp.html
Outdated
@@ -247,6 +248,12 @@ <h2 id="adman">Adman</h2> | |||
data-host="talos.adman.gr"> | |||
</amp-ad> | |||
|
|||
<h2 id="admanmedia">AdmanMedia</h2> | |||
<amp-ad width="300" height="250" | |||
type="admanmedia" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indentation here.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use encodeURIComponent(data.id)
@@ -265,6 +266,12 @@ | |||
data-host="talos.adman.gr"> | |||
</amp-ad> | |||
|
|||
<h2>AdmanMedia</h2> | |||
<amp-ad width="300" height="250" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}"]`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encodedId here as well?
Look good in general. Few minor requests. |
LGTM. Thanks for the Pull Request. Merged. |
AdMan Media ad network type implementation