-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Changes from 7 commits
bda8207
3835b41
7373aa9
8cafbc7
7ab3882
5752551
077d34a
1bb840e
8c6d37a
00b9075
0ba275f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright 2017 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 {validateData, loadScript} from '../3p/3p'; | ||
|
||
/** | ||
* @param {!Window} global | ||
* @param {!Object} data | ||
*/ | ||
export function admanmedia(global, data) { | ||
validateData(data, ['id']); | ||
|
||
loadScript(global, `https://mona.admanmedia.com/go?id=${data.id}`, () => { | ||
const pattern = `script[src$="id=${data.id}"]`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. encodedId here as well? |
||
const scriptTag = global.document.querySelector(pattern); | ||
scriptTag.setAttribute('id', `hybs-${data.id}`); | ||
global.context.renderStart(); | ||
}, () => { | ||
global.context.noContentAvailable(); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!--- | ||
Copyright 2017 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. | ||
--> | ||
|
||
# Admanmedia | ||
|
||
Please visit our web (http://www.admanmedia.com) for more details | ||
## Example | ||
|
||
```html | ||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. nit: indentation here. |
||
``` | ||
|
||
## Configuration | ||
|
||
__Required:__ | ||
|
||
- `data-id` - Adunit unique id |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ | |
<option>adgeneration</option> | ||
<option>adhese</option> | ||
<option>adman</option> | ||
<option>admanmedia</option> | ||
<option>adreactor</option> | ||
<option>adsense</option> | ||
<option>adsnative</option> | ||
|
@@ -265,6 +266,12 @@ <h2>Adman</h2> | |
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 commentThe 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 commentThe 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: There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
type="admanmedia" | ||
data-id="8e916419"> | ||
</amp-ad> | ||
|
||
<h2>AdReactor</h2> | ||
<amp-ad width="728" height="90" | ||
type="adreactor" | ||
|
@@ -639,7 +646,7 @@ <h2>FlexOneHARRIER</h2> | |
data-section-id="2267" | ||
data-slot="2843"> | ||
</amp-ad> | ||
|
||
<h2>Felmat</h2> | ||
<amp-ad width="300" height="250" | ||
type="felmat" | ||
|
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)