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

amp-ad type=dotandads implementation #1705

Merged
merged 1 commit into from Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions 3p/integration.js
Expand Up @@ -29,6 +29,7 @@ import {adsense} from '../ads/adsense';
import {adtech} from '../ads/adtech';
import {plista} from '../ads/plista';
import {doubleclick} from '../ads/doubleclick';
import {dotandads} from '../ads/dotandads';
import {facebook} from './facebook';
import {manageWin} from './environment';
import {nonSensitiveDataPostMessage, listenParent} from './messaging';
Expand All @@ -53,6 +54,7 @@ register('adtech', adtech);
register('plista', plista);
register('doubleclick', doubleclick);
register('taboola', taboola);
register('dotandads', dotandads);
register('_ping_', function(win, data) {
win.document.getElementById('c').textContent = data.ping;
});
Expand Down
2 changes: 2 additions & 0 deletions ads/_config.js
Expand Up @@ -25,6 +25,7 @@ export const adPrefetch = {
doubleclick: 'https://www.googletagservices.com/tag/js/gpt.js',
a9: 'https://c.amazon-adsystem.com/aax2/assoc.js',
adsense: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
dotandads: 'https://amp.ad.dotandad.com/dotandadsAmp.js',
};

/**
Expand All @@ -43,6 +44,7 @@ export const adPreconnect = {
'https://securepubads.g.doubleclick.net',
'https://tpc.googlesyndication.com',
],
dotandads: 'https://bal.ad.dotandad.com',
};

/**
Expand Down
26 changes: 26 additions & 0 deletions ads/dotandads.js
@@ -0,0 +1,26 @@
/**
* Copyright 2015 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 {writeScript} from '../src/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function dotandads(global, data) {
global.data = data;
writeScript(global, 'https://amp.ad.dotandad.com/dotandadsAmp.js');
}
51 changes: 51 additions & 0 deletions ads/dotandads.md
@@ -0,0 +1,51 @@
<!---
Copyright 2015 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.
-->

# DotAndAds

## Example

300x250 box:
```html
<amp-ad width=300 height=250
type="dotandads"
data-sp="300x250-u"
data-mpo="ampTest"
data-mpt="amp-amp-all-all">
</amp-ad>
```

980x250 masthead:
```html
<amp-ad width=980 height=250
type="dotandads"
data-sp='sn-u'
data-cid="11"
data-mpo="ampTest"
data-mpt="amp-amp-all-all">
</amp-ad>
```

## Configuration

For semantics of configuration, please see ad network documentation.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe in a follow up send a PR with a link, so people know where to look.


Supported parameters:

- sp: sizepos (the ad size and position code)
- mpo: multipoint (an extraction parameter based on site)
- mpt: mediapoint tag (the box where the ad will be shown)
- cid: customer id
19 changes: 18 additions & 1 deletion examples/ads.amp.html
Expand Up @@ -142,6 +142,23 @@ <h2>Taboola responsive widget</h2>
data-placement="Ads Example"
data-article="auto">
</amp-embed>


<h2>DotAndAds masthead</h2>
<amp-ad width=980 height=250
type="dotandads"
data-cid="11"
data-mpo="ampTest"
data-mpt="amp-amp-all-all"
data-sp='sn-u'>
</amp-ad>

<h2>DotAndAds 300x250 box</h2>
<amp-ad width=300 height=250
type="dotandads"
data-sp='300x250-u'
data-cid="11"
data-mpo="ampTest"
data-mpt="amp-amp-all-all">
</amp-ad>
</body>
</html>