diff --git a/3p/integration.js b/3p/integration.js index 57c324c72634..3539b7194175 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -47,6 +47,7 @@ import {taboola} from '../ads/taboola'; import {smartadserver} from '../ads/smartadserver'; import {revcontent} from '../ads/revcontent'; import {openadstream} from '../ads/openadstream'; +import {teads} from '../ads/teads'; /** * Whether the embed type may be used with amp-embed tag. @@ -76,6 +77,7 @@ register('smartadserver', smartadserver); register('mediaimpact', mediaimpact); register('revcontent', revcontent); register('openadstream', openadstream); +register('teads', teads); // For backward compat, we always allow these types without the iframe // opting in. diff --git a/ads/_config.js b/ads/_config.js index 89a0a9a81f8a..5167afbaf3d2 100644 --- a/ads/_config.js +++ b/ads/_config.js @@ -33,6 +33,7 @@ export const adPrefetch = { smartadserver: 'https://ec-ns.sascdn.com/diff/js/smart.js', yieldmo: 'https://static.yieldmo.com/ym.amp1.js', revcontent: 'https://labs-cdn.revcontent.com/build/amphtml/revcontent.amp.min.js', + teads: 'https://cdn.teads.tv/media/format/v3/teads-format.min.js', }; /** @@ -51,6 +52,12 @@ export const adPreconnect = { 'https://trc.taboola.com', 'https://images.taboola.com', ], + teads: [ + 'https://cdn.teads.tv', + 'https://cdn2.teads.tv', + 'https://a.teads.tv', + 'https://t.teads.tv', + ], doubleclick: [ 'https://partner.googleadservices.com', 'https://securepubads.g.doubleclick.net', diff --git a/ads/teads.js b/ads/teads.js new file mode 100644 index 000000000000..4e24141a8b08 --- /dev/null +++ b/ads/teads.js @@ -0,0 +1,34 @@ +/** + * 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 {loadScript, checkData, validateDataExists} from '../src/3p'; + +/** + * @param {!Window} global + * @param {!Object} data + */ +export function teads(global, data) { + /*eslint "google-camelcase/google-camelcase": 0*/ + global._teads_amp = { + allowed_data: ['pid'], + data: data, + }; + + validateDataExists(data, global._teads_amp.allowed_data); + checkData(data, global._teads_amp.allowed_data); + + loadScript(global, 'https://a.teads.tv/page/' + encodeURIComponent(data.pid) + '/tag'); +} diff --git a/ads/teads.md b/ads/teads.md new file mode 100644 index 000000000000..df79de432c61 --- /dev/null +++ b/ads/teads.md @@ -0,0 +1,38 @@ + + +# Teads + +## Example + +```html + +
Teads fallback - Discover inRead by Teads!
+
+``` + +## Configuration + +For semantics of configuration, please contact [Teads](http://teads.tv/fr/contact/). + +Teads amp-ad component is designed to work with layout="responsive", so please be careful to keep width and height at a 4/3 ratio. + +Supported parameters: + +- data-pid diff --git a/builtins/amp-ad.md b/builtins/amp-ad.md index bc5e4cd64673..f7cce5c8ecea 100644 --- a/builtins/amp-ad.md +++ b/builtins/amp-ad.md @@ -104,6 +104,7 @@ resources in AMP. It requires a `type` argument that select what ad network is d - [Smart AdServer](../ads/smartadserver.md) - [Yieldmo](../ads/yieldmo.md) - [Revcontent](../ads/revcontent.md) +- [Teads](../ads/teads.md) ## Styling diff --git a/examples/ads.amp.html b/examples/ads.amp.html index 82890c2e28cb..de026f5a9444 100644 --- a/examples/ads.amp.html +++ b/examples/ads.amp.html @@ -70,6 +70,15 @@

AdTech

src="https://adserver.adtechus.com/addyn/3.0/5280.1/2274008/0/-1/ADTECH;size=300x250;key=plumber;alias=careerbear-ros-middle1;loc=300;;target=_blank;grp=27980912;misc=3767074"> +

Teads

+ + +
Teads fallback - Discover inRead by Teads !
+
+

Doubleclick