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

Please add I-Mobile support to amp-ad #2470

Closed
wants to merge 116 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
2b57460
Implement Teads on Google AMP Ads network
RonanDrouglazet Dec 4, 2015
0e79ae2
Turn on unique origins for dev channel by default.
cramforce Feb 29, 2016
4707b3e
Document --fortesting
cramforce Feb 29, 2016
cdc7ee7
Do not wait for messaging unless the document is embedded
Feb 25, 2016
72f1039
Add vendor configuration, Readme, example and test for mediametrie an…
Feb 27, 2016
bbeeb02
Cleanup FixedLayer experiment
Feb 26, 2016
014faa8
Redesign for login-done page
Feb 27, 2016
0ad878b
Require origin for message channel
Feb 27, 2016
572f5a0
Fix header levels on analytics vendors
rudygalfi Mar 1, 2016
52f027f
Added more valid Adform hosts.
Feb 29, 2016
138b437
Request count starts at one, not zero
rejeep Mar 1, 2016
667a354
Add missing comma to sample
cramforce Mar 1, 2016
1475b98
Use 'gulp-load-plugins' to load gulp plugins, reducing the number of …
ataylorme Mar 1, 2016
3f78c71
Handle custom protocols on iOS Safari.
mkhatib Feb 26, 2016
091040e
cancel autoplay once user interacts with carousel(type=slides)
erwinmombay Feb 25, 2016
8b31867
Added third party code Optimized Inline SVG Icons
paul-matthews Feb 9, 2016
f14fecc
Making local changes to third_party optimized-svg-icons
paul-matthews Feb 11, 2016
1524b6e
Adding LICENSE file for Optimized Inline SVG Icons
paul-matthews Feb 11, 2016
44886d3
Adding TripleLift to amp-ads
Feb 27, 2016
6c8d23f
Hide placeholder when the ad fallback is shown.
mkhatib Mar 1, 2016
f4358a1
Viewer-based openDialog API
Mar 1, 2016
3cdfc06
Disable SRA and mark 1% of GPT requests as control
gduchene Feb 26, 2016
7b09627
Modifies the Glade code in doubleclick.js to use "fill" size for the …
nekodo Mar 2, 2016
1814526
Add Criteo support to amp-ad
nicolastruchi Feb 26, 2016
58af282
Enable unique 3p hostnames for everyone.
cramforce Mar 2, 2016
57aca17
Log 100% of 3p errors and mark traffic from the default origin as "CDN".
cramforce Mar 2, 2016
595fff2
Render amp-youtube lazily.
mkhatib Mar 2, 2016
fc72449
Launch amp-access-analytics
Mar 2, 2016
6168a2d
whitelist branches with the name amp-release-.* for a travis build
erwinmombay Mar 2, 2016
d9e4c10
Disallow various slashes in data- attributes.
Gregable Mar 2, 2016
a1f3cbf
Change 'author stylesheet' to 'style amp-custom'.
powdercloud Mar 2, 2016
7719641
Flip the order of "tag" and '%1' for consistency and easier i18n.
powdercloud Mar 2, 2016
e7eb082
Add a format for the UNKNOWN_CODE.
powdercloud Mar 2, 2016
560a8e6
Allow upper case hex codes for some <amp-dailymotion data-video-id> a…
Gregable Mar 2, 2016
97a29e8
Point the spec URLs to ampproject.org instead of github (#1687).
honeybadgerdontcare Mar 2, 2016
9e52ffa
Getting ready to allow relative URLs only in a subset of tags.
honeybadgerdontcare Mar 2, 2016
8c6857c
2nd attempt for fixing <link rel="mask-icon" ...>
Gregable Mar 2, 2016
f675b3d
Enforce value="" in javascript validator.
honeybadgerdontcare Mar 2, 2016
1aab27f
Add tagname to STYLESHEET_TOO_LONG format string.
powdercloud Mar 2, 2016
10b92a6
Allow singular attributes to have values equal to their name.
honeybadgerdontcare Mar 2, 2016
143fe8e
Point the spec URLs to ampproject.org instead of github (#1687).
honeybadgerdontcare Mar 2, 2016
c04f53c
Port parse_css.extractUrls to Javascript.
powdercloud Mar 2, 2016
494fb7a
Run parse_css.extractUrls in the validator.
powdercloud Mar 2, 2016
31ca098
Couple format string fixes.
powdercloud Mar 2, 2016
22dc997
Ability to deprecate tags, such as the old boilerplate syntax.
honeybadgerdontcare Mar 2, 2016
265b012
Fix violation of a presubmit rule
cramforce Mar 3, 2016
2221172
Cleanup for amp-analytics-experiment
Mar 2, 2016
84d1c83
i18n for login done page
Mar 2, 2016
680797f
Force GPT for doubleclick test.
cramforce Mar 2, 2016
d9b3b6b
Clarify extraUrlParams documentation
rudygalfi Mar 2, 2016
ea32665
Fixing markdown for use of asterisk
src-code Mar 3, 2016
617e67e
Micro optimizations for our dom library.
cramforce Mar 2, 2016
547e9b7
remove reference to whenFirstLayoutCompleteResolve_
erwinmombay Mar 4, 2016
bb88999
Make the canonical URL in the test not depend on relative URL resolut…
cramforce Mar 4, 2016
3eecf50
Add new variable substitutions: VIEWPORT_WIDTH and VIEWPORT_HEIGHT
steffenweber Mar 4, 2016
138d07a
Resend pingback after successfull and wait for the most recent auth r…
Mar 3, 2016
4498895
Fix test in firefox
cramforce Mar 4, 2016
df27bb1
Major improvements to instagram extension.
cramforce Mar 4, 2016
93fe575
Implement an alternative loading strategy for ads.
cramforce Mar 3, 2016
6136a03
Optimize vsync
cramforce Mar 4, 2016
becf81f
Use location.replace for click interception and only when iframed
Mar 4, 2016
9b36fe8
Allow using preloading over prefetching.
mkhatib Mar 2, 2016
c748c49
update links to new ampbyexample.com domain
sebastianbenz Mar 6, 2016
9ae52f2
Some additional details how to do local dev.
cramforce Mar 7, 2016
f9e14e1
Initial ISSUE template.
cramforce Mar 7, 2016
7ca0770
s/how fast/whether
cramforce Mar 7, 2016
4085f54
Add redirect from `examples` to `examples.build`.
cramforce Mar 7, 2016
9afaaff
Update Chartbeat link
breauxc Mar 7, 2016
aa72347
stop matching doc.contains when there are intermediate accessors
erwinmombay Mar 7, 2016
1f2f63c
Unbreak mailto: links inside embedded AMP docs on iOS Safari.
mkhatib Mar 5, 2016
a907b33
Fix preload warning for invalid as attribute.
mkhatib Mar 8, 2016
1635ec1
Simplify extension code generation.
cramforce Mar 9, 2016
30ee1c1
Add #404_is_fine to sddefault in amp-youtube
mkhatib Mar 9, 2016
a6a985d
Performance measurements adjustments.
cramforce Mar 8, 2016
ec3f6eb
ignore setFlushParams request
erwinmombay Feb 25, 2016
788f9e9
adding rubicon adapter
Mar 7, 2016
0f84baa
Don't swallow errors in URL replacements promises.
cramforce Mar 9, 2016
8355dfd
Consistent examples: specify responsive layout
Mar 8, 2016
f6fc4ee
History push for click interceptor
Mar 4, 2016
94dd370
Revert "Fix preload warning for invalid as attribute."
mkhatib Mar 9, 2016
27748a6
Moved validation error table to end of spec.
Meggin Mar 9, 2016
7433e5c
Moved validation error table to end of spec.
Meggin Mar 9, 2016
de094db
Moved validation error table to end of spec.
Meggin Mar 9, 2016
c25aebc
Moved validation error table to end of spec.
Meggin Mar 9, 2016
723f151
Moved validation error table to end of spec.
Meggin Mar 9, 2016
8e23631
Moved validation error table to end of spec.
Meggin Mar 9, 2016
fc4c7c9
Moved validation error table to end of spec.
Meggin Mar 9, 2016
495c03a
Moved validation error table to end of spec.
Meggin Mar 9, 2016
d2d7fbd
Moved validation error table to end of spec.
Meggin Mar 9, 2016
4c7b364
Moved validation error table to end of spec.
Meggin Mar 9, 2016
2508940
Moved validation error table to end of spec.
Meggin Mar 9, 2016
c567ba9
Moved validation error table to end of spec.
Meggin Mar 9, 2016
0690c51
Moved validation error table to end of spec.
Meggin Mar 9, 2016
1c93649
Moved validation error table to end of spec.
Meggin Mar 9, 2016
e08bb6d
Moved validation error table to end of spec.
Meggin Mar 9, 2016
2c3aa9b
Moved validation error table to end of spec.
Meggin Mar 9, 2016
882be14
Moved validation error table to end of spec.
Meggin Mar 9, 2016
d23bbc6
Moved validation error table to end of spec.
Meggin Mar 9, 2016
e357d30
Moved validation error table to end of spec.
Meggin Mar 9, 2016
bc813a7
Document AMP's release schedule.
cramforce Mar 9, 2016
86e8529
Moved validation error table to end of spec.
Meggin Mar 9, 2016
f327752
Moved validation error table to end of spec.
Meggin Mar 9, 2016
bd84779
Moved validation error table to end of spec.
Meggin Mar 9, 2016
2ec2d76
Moved validation error table to end of spec.
Meggin Mar 9, 2016
2685a92
Moved validation error table to end of spec.
Meggin Mar 9, 2016
bc1467a
Moved validation error table to end of spec.
Meggin Mar 9, 2016
2ae8fc8
Moved validation error table to end of spec.
Meggin Mar 9, 2016
7fcca84
Moved validation error table to end of spec.
Meggin Mar 9, 2016
8b5c7d8
Moved validation error table to end of spec.
Meggin Mar 9, 2016
88f35f4
syntax fix for mixing dep
andyhills Mar 9, 2016
e99d19e
Implementing AMP Social Share Extension
paul-matthews Feb 4, 2016
9468376
Handle legacy alert, etc. in AMP ads.
cramforce Mar 9, 2016
3c49c63
Support placeholder for Tweets.
cramforce Mar 10, 2016
278ddae
Quick fix for flakiness
cramforce Mar 10, 2016
df6d95e
Remove old docs directory and point to docs-site more clearly.
cramforce Mar 10, 2016
aba4953
add imobile 3p module
ilovelili Mar 4, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ branches:
- master
- release
- canary
- /^amp-release-.*$/
env:
global:
- NPM_CONFIG_PROGRESS="false"
28 changes: 28 additions & 0 deletions 3p/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function manageWin_(win) {
installObserver(win);
// Existing iframes.
maybeInstrumentsNodes(win, win.document.querySelectorAll('iframe'));
blockSyncPopups(win);
}


Expand Down Expand Up @@ -237,6 +238,33 @@ function instrumentEntryPoints(win) {
}
}

/**
* Blackhole the legacy popups since they should never be used for anything.
* @param {!Window} win
*/
function blockSyncPopups(win) {
let count = 0;
function maybeThrow() {
// Prevent deep recursion.
if (count++ > 2) {
throw new Error('security error');
}
}
try {
win.alert = maybeThrow;
win.prompt = function() {
maybeThrow();
return '';
};
win.confirm = function() {
maybeThrow();
return false;
};
} catch (e) {
console./*OK*/error(e.message, e.stack);
}
}

/**
* Run when we just became visible again. Runs all the queued up rafs.
* @visibleForTesting
Expand Down
10 changes: 10 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {adreactor} from '../ads/adreactor';
import {adsense} from '../ads/adsense';
import {adtech} from '../ads/adtech';
import {plista} from '../ads/plista';
import {criteo} from '../ads/criteo';
import {doubleclick} from '../ads/doubleclick';
import {dotandads} from '../ads/dotandads';
import {endsWith} from '../src/string';
Expand All @@ -47,6 +48,10 @@ import {taboola} from '../ads/taboola';
import {smartadserver} from '../ads/smartadserver';
import {revcontent} from '../ads/revcontent';
import {openadstream} from '../ads/openadstream';
import {triplelift} from '../ads/triplelift';
import {teads} from '../ads/teads';
import {rubicon} from '../ads/rubicon';
import {imobile} from '../ads/imobile';

/**
* Whether the embed type may be used with amp-embed tag.
Expand All @@ -62,6 +67,7 @@ register('adreactor', adreactor);
register('adsense', adsense);
register('adtech', adtech);
register('plista', plista);
register('criteo', criteo);
register('doubleclick', doubleclick);
register('flite', flite);
register('taboola', taboola);
Expand All @@ -76,6 +82,10 @@ register('smartadserver', smartadserver);
register('mediaimpact', mediaimpact);
register('revcontent', revcontent);
register('openadstream', openadstream);
register('triplelift', triplelift);
register('teads', teads);
register('rubicon', rubicon);
register('imobile', imobile);

// For backward compat, we always allow these types without the iframe
// opting in.
Expand Down
2 changes: 1 addition & 1 deletion 3p/remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script>
draw3p(undefined,
// List of expected amp-ad types.
['allowed-ad-type1', 'allowed-ad-type2']
['allowed-ad-type1', 'allowed-ad-type2'],
// List of hostnames that are allowed to embed this change.
// Please also use ALLOW-FROM X-Frame-Options to get security in
// browsers that do not support location.ancestorOrigins.
Expand Down
16 changes: 10 additions & 6 deletions 3p/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ export function twitter(global, data) {
delete data.height;
twttr.widgets.createTweet(data.tweetid, tweet, data)./*OK*/then(() => {
const iframe = global.document.querySelector('#c iframe');
// Unfortunately the tweet isn't really done at this time.
// We listen for resize to learn when things are
// really done.
iframe.contentWindow.addEventListener('resize', function() {
// There is no iframe if the tweet was deleted. Thanks for resolving
// the promise, though :)
if (iframe && iframe.contentWindow) {
// Unfortunately the tweet isn't really done at this time.
// We listen for resize to learn when things are
// really done.
iframe.contentWindow.addEventListener('resize', function() {
render();
}, true);
render();
}, true);
render();
}
});
});

Expand Down
21 changes: 14 additions & 7 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ If you have any questions, feel free to ask on the issue or join us on [Slack](h

| Command | Description |
| ----------------------------- | --------------------------------------------------------------------- |
| `gulp` | Runs "watch" and "serve". |
| **`gulp`** | Runs "watch" and "serve". Use this for standard local dev. |
| `gulp dist` | Builds production binaries. |
| `gulp dist --fortesting` | Indicates the production binaries are used for local testing. Without this ads, tweets and similar use cases are expected to break locally when using minified sources.|
| `gulp lint` | Validates against Google Closure Linter. |
| `gulp lint --watch` | Watches for changes in files, Validates against Google Closure Linter.|
| `gulp lint --fix` | Fixes simple lint warnings/errors automatically. |
Expand All @@ -61,13 +62,8 @@ If you have any questions, feel free to ask on the issue or join us on [Slack](h
| `gulp test --saucelabs` | Runs test on saucelabs (requires [setup](#saucelabs)). |
| `gulp test --safari` | Runs tests in Safari. |
| `gulp test --firefox` | Runs tests in Firefox. |
| `gulp serve` | Serves content in repo root dir over http://localhost:8000/. |
|-------------------------------|-----------------------------------------------------------------------|
| `gulp serve` | Serves content in repo root dir over http://localhost:8000/. Examples live in http://localhost:8000/examples.build/ |

To fix issues with Safari test runner launching multiple instances of the test, run:
<pre>
defaults write com.apple.Safari ApplePersistenceIgnoreState YES
</pre>

#### Saucelabs

Expand All @@ -86,6 +82,17 @@ If a test flaked on a pull request you can ask for a retry by sending the commen

### Manual testing

#### Examples

The content in the `examples` directory can be reached at: http://localhost:8000/examples.build/

For each example there are 3 files:

- Original name: This points to prod. This file would not reflect your local changes.
- `.max.html` points to your local unminified AMP. You want to use this during normal dev.
- `.min.html` points to a local minified AMP. This is closer to the prod setup. Only available after running `gulp dist`.


#### Document proxy

AMP ships with a local proxy for testing production AMP documents with the local JS version.
Expand Down
24 changes: 24 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Please walk through the following steps for reporting an issue about AMP:

- Please ask general questions about AMP over on stackoverflow under the AMP HTML tag: http://stackoverflow.com/questions/tagged/amp-html
- Please ask/post questions/problems related to Google Search in Google's AMP forum: https://goo.gl/utQ1KZ

## Short description of your issue:

Start by deleting everything above this including this sentence :)

## How do we reproduce the issue?

Please post a public URL and ideally post a reduced test case. E.g. on jsbin.com that exhibits only your issue and nothing else.

1. Step 1 to reproduce
2. Step 2 to reproduce
3. …

## What browsers are affected?

All browsers? Some specific browser? What device type?

## Which AMP version is affected?

Is this a new issue? Or was it always broken? Paste your AMP version. You can find it in the browser dev tools.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ This allows the AMP library to include:

Get started [creating your first AMP page](https://www.ampproject.org/docs/get_started/create_page.html).

[Full docs and reference.](https://www.ampproject.org/docs/get_started/about-amp.html)

## The AMP JS library

The AMP JS library provides [builtin](builtins/README.md) AMP Components, manages the loading of external resources, and ensures a reliably fast time-to-paint.

## The AMP Validator

The AMP Validator allows a web developer to easily identify if the web page
doesn't meet the [AMP HTML specification](spec/amp-html-format.md).
doesn't meet the [AMP HTML specification](https://www.ampproject.org/docs/reference/spec.html).

Adding "#development=1" to the URL of the page instructs the AMP Runtime to run
a series of assertions confirming the page's markup meets the AMP HTML
Expand All @@ -81,23 +83,21 @@ or replace functionality of core HTML5 elements to allow the runtime to ensure
it is solely responsible for loading external assets and to provide for shared
best practices in implementation.

These components can:
* Replace HTML5 elements that are not directly permitted in the specification
such as [amp-img](builtins/amp-img.md) and [amp-video](builtins/amp-video.md).
* Implement embedded third-party content, such as
[amp-ad](builtins/amp-ad.md),
[amp-pinterest](extensions/amp-pinterest/amp-pinterest.md),
[amp-twitter](extensions/amp-twitter/amp-twitter.md),
and [amp-youtube](extensions/amp-youtube/amp-youtube.md).
* Provide for common patterns in web pages,
such as [amp-lightbox](extensions/amp-lightbox/amp-lightbox.md)
and [amp-carousel](extensions/amp-carousel/amp-carousel.md).
* Make advanced performance techniques easy,
such as [amp-anim](extensions/amp-anim/amp-anim.md),
which allows web developers to dynamically serve animated images
as either image files (GIF) or video files (WebM or MP4) based on browser compatibility.

# AMP Dev Channel
See our [docs and reference](https://www.ampproject.org/docs/get_started/about-amp.html) for more info.

# Releases

We push a new release of AMP to all AMP pages every week on Thursday. The more detailed schedule is as follows:

- Every Thursday we cut a green release from our `master` branch.
- This is then pushed to users of AMP who opted into the [AMP Dev Channel](#amp-dev-channel).
- On Monday we check error rates for opt-in users and bug reports and if everything looks fine, we push this new release to 1% of AMP pages.
- We then continue to monitor error rates and bug reports throughout the week.
- On Thursday the "Dev Channel" release from last Thursday is then pushed to all users.

You can always follow the current release state of AMP on our [releases page](https://github.com/ampproject/amphtml/releases). The release used by most users is marked as `Latest release` and the current Dev Channel release is marked as `Pre-release`.

## AMP Dev Channel

AMP Dev Channel is a way to opt a browser into using a newer version of the AMP JS libraries.

Expand Down
2 changes: 1 addition & 1 deletion ads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var unlisten = window.context.onResizeDenied(function(requestedHeight) {
});
```

Here are some factors that affect how fast the resize will be executed:
Here are some factors that affect whether the resize will be executed:

- Whether the resize is triggered by the user action;
- Whether the resize is requested for a currently active ad;
Expand Down
23 changes: 23 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ export const adPrefetch = {
],
a9: 'https://c.amazon-adsystem.com/aax2/assoc.js',
adsense: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
criteo: 'https://static.criteo.net/js/ld/publishertag.js',
dotandads: 'https://amp.ad.dotandad.com/dotandadsAmp.js',
mediaimpact: 'https://ec-ns.sascdn.com/diff/251/divscripte/amp.js',
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',
imobile: 'https://spamp.i-mobile.co.jp/script/amp.js',
};

/**
Expand All @@ -51,6 +54,15 @@ 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',
],
criteo: [
'https://cas.criteo.com',
],
doubleclick: [
'https://partner.googleadservices.com',
'https://securepubads.g.doubleclick.net',
Expand All @@ -62,11 +74,22 @@ export const adPreconnect = {
'https://s.yieldmo.com',
'https://ads.yieldmo.com',
],
triplelift: [
'https://ib.3lift.com',
'https://dynamic.3lift.com',
'https://img.3lift.com',
'https://eb2.3lift.com',
],
revcontent: [
'https://trends.revcontent.com',
'https://cdn.revcontent.com',
'https://img.revcontent.com',
],
rubicon: [
'https://ads.rubiconproject.com',
'https://optimized-by.rubiconproject.com',
],
imobile: 'https://spad.i-mobile.co.jp',
};

/**
Expand Down
12 changes: 8 additions & 4 deletions ads/adform.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ import {writeScript, validateSrcPrefix, validateExactlyOne} from '../src/3p';

// Valid adform ad source hosts
const hosts = {
track: 'https://track.adform.net/',
adx: 'https://adx.adform.net/',
track: 'https://track.adform.net',
adx: 'https://adx.adform.net',
a2: 'https://a2.adform.net',
adx2: 'https://adx2.adform.net',
asia: 'https://asia.adform.net',
adx3: 'https://adx3.adform.net',
};

/**
Expand All @@ -42,11 +46,11 @@ export function adform(global, data) {
}
// Ad tag using "data-bn" attribute
else if (bn) {
url = hosts.track + 'adfscript/?bn=' + encodeURIComponent(bn) + ';msrc=1';
url = hosts.track + '/adfscript/?bn=' + encodeURIComponent(bn) + ';msrc=1';
}
// Ad placement using "data-mid" attribute
else if (mid) {
url = hosts.adx + 'adx/?mid=' + encodeURIComponent(mid);
url = hosts.adx + '/adx/?mid=' + encodeURIComponent(mid);
}

writeScript(global, url);
Expand Down
5 changes: 1 addition & 4 deletions ads/adform.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,4 @@ information on how to get required ad tag or placement IDs.
Only one of the mentioned parameters should be used at the same time.

The `src` parameter must use **https** protocol and must be from one of the
allowed hosts:

- `https://track.adform.net/...`
- `https://adx.adform.net/...`
allowed Adform hosts.
27 changes: 27 additions & 0 deletions ads/criteo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* 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} from '../src/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function criteo(global, data) {
loadScript(global, 'https://static.criteo.net/js/ld/publishertag.js', () => {
Criteo.DisplayAd({'zoneid': data.zone});
});
}
Loading