Skip to content
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

Merged
merged 11 commits into from May 26, 2017
Merged

Conversation

luciancrasovan
Copy link

AdMan Media ad network type implementation

  • This implements basic amp-ad for admanmedia with a single data parameter
  • Unique size ads: 300 X 250
  • No layout configuration
  • No viewability control

@googlebot
Copy link

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@luciancrasovan
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@luciancrasovan
Copy link
Author

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!

@luciancrasovan
Copy link
Author

This is for the AdMan Media company http://admanmedia.com/
It urges us to see it available in the Repository in order to be able to test it with real clients so a fast acceptance of this pull request will be highly appreciated!

@lcrasovan
Copy link

Hello,

Is any news about this pull request?

Thanks in advance

@jasti
Copy link
Contributor

jasti commented Mar 27, 2017

@lannka @zhouyx would you please review this PR? Thanks.

@zhouyx zhouyx added this to Backlog (Should be Closed) in 3P Ads & Analytics Support May 1, 2017
@zhouyx zhouyx self-assigned this May 4, 2017
ads/_config.js Outdated
@@ -75,6 +75,8 @@ export const adConfig = {

adman: {},

admanmedia: {},
Copy link
Contributor

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

@@ -0,0 +1,32 @@
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

* @param {!Object} data
*/
export function admanmedia(global, data) {
validateData(data, ['id'], []);
Copy link
Contributor

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.

@@ -0,0 +1,32 @@
<!---
Copyright 2016 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

export function admanmedia(global, data) {
validateData(data, ['id'], []);

const script = global.document.createElement('script');
Copy link
Contributor

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.

@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix indentation.

Copy link
Contributor

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?

@zhouyx zhouyx moved this from Backlog to In Review in 3P Ads & Analytics Support May 4, 2017
@lcrasovan
Copy link

Hello @zhouyx , we have just uploaded our changes. Could you please review and let us know if everything is ok?

<amp-ad width="300" height="250"
type="admanmedia"
data-id="8e916419">
</amp-ad>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation here.

export function admanmedia(global, data) {
validateData(data, ['id']);

loadScript(global, `https://mona.admanmedia.com/go?id=${data.id}`, () => {
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get error when testing locally. Could you please take a look?
image

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

Copy link
Contributor

@zhouyx zhouyx May 23, 2017

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?

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.


const encodedId = encodeURIComponent(data.id);
loadScript(global, `https://mona.admanmedia.com/go?id=${encodedId}`, () => {
const pattern = `script[src$="id=${data.id}"]`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encodedId here as well?

@zhouyx
Copy link
Contributor

zhouyx commented May 23, 2017

Look good in general. Few minor requests.

@zhouyx zhouyx merged commit 82bdc49 into ampproject:master May 26, 2017
@zhouyx
Copy link
Contributor

zhouyx commented May 26, 2017

LGTM. Thanks for the Pull Request. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants