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

✨ PromoteIQ : add #20694

Merged
merged 12 commits into from
Feb 20, 2019
2 changes: 2 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ import {polymorphicads} from '../ads/polymorphicads';
import {popin} from '../ads/popin';
import {postquare} from '../ads/postquare';
import {pressboard} from '../ads/pressboard';
import {promoteiq} from '../ads/promoteiq';
import {pubexchange} from '../ads/pubexchange';
import {pubguru} from '../ads/pubguru';
import {pubmatic} from '../ads/pubmatic';
Expand Down Expand Up @@ -434,6 +435,7 @@ register('polymorphicads', polymorphicads);
register('popin', popin);
register('postquare', postquare);
register('pressboard', pressboard);
register('promoteiq', promoteiq);
register('pubexchange', pubexchange);
register('pubguru', pubguru);
register('pubmatic', pubmatic);
Expand Down
2 changes: 2 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ export const adConfig = {
renderStartImplemented: true,
},

'promoteiq': {},
aisleypay marked this conversation as resolved.
Show resolved Hide resolved

'pubexchange': {},

'pubguru': {
Expand Down
7 changes: 7 additions & 0 deletions ads/ads.extern.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,13 @@ data.categories;
data.media;
data.baseUrl;

// promoteiq.js
aisleypay marked this conversation as resolved.
Show resolved Hide resolved
window.TagDeliveryContent;
window.TagDeliveryContent.request;
data.sfcallback;
data.params;
data.src;

// pubguru.js
data.height;
data.publisher;
Expand Down
40 changes: 40 additions & 0 deletions ads/promoteiq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2019 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 {dev} from '../src/log';
import {loadScript, validateData} from '../3p/3p';
import {parseJson} from '../src/json';

const TAG = 'PROMOTEIQ';
const mandatoryDataFields = ['src', 'params', 'sfcallback'];

/**
* @param {!Window} global
* @param {!Object} data
*/
export function promoteiq(global, data) {
validateData(data, mandatoryDataFields, []);
const sfInputs = parseJson(data.params);
aisleypay marked this conversation as resolved.
Show resolved Hide resolved

loadScript(global, data.src, () => {
aisleypay marked this conversation as resolved.
Show resolved Hide resolved
if (!!global.TagDeliveryContent) {
aisleypay marked this conversation as resolved.
Show resolved Hide resolved
const sfCallback = new Function('return ' + data.sfcallback);
global.TagDeliveryContent.request(sfInputs, sfCallback);
} else {
dev().error(TAG, 'TagDeliveryContent object not loaded on page');
aisleypay marked this conversation as resolved.
Show resolved Hide resolved
}
});
}
40 changes: 40 additions & 0 deletions ads/promoteiq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!---
Copyright 2019 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.
-->

# PromoteIQ

Provides support for AMP integration with [PromoteIQ](https://www.promoteiq.com/).

## Example

```html
<amp-ad width="250" height="250"
type="promoteiq"
data-src="https://example.com/cdn/file.js"
data-params='{"param1": "XXX", "param2": "YYY", ....}'
data-sfcallback='function (response){ return response;}'>
</amp-ad>
```

### Required parameters

- `data-src`: Publisher specific PromoteIQ CDN file.
- `data-input`: JSON stringified inputs.
- `data-sfcallback`: Stringified publisher rendering function.

# Support

For further queries, please feel free to reach out to your contact at PromoteIQ.
9 changes: 9 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<option>polymorphicads</option>
<option>popin</option>
<option>pressboard</option>
<option>promoteiq</option>
<option>pubexchange</option>
<option>pubmine</option>
<option>pulsepoint</option>
Expand Down Expand Up @@ -1459,6 +1460,14 @@ <h2>Pressboard</h2>
data-media="5">
</amp-ad>

<h2>PromoteIQ</h2>
<amp-ad width="250" height="250"
type="promoteiq"
data-src="https://cdn.tagdelivery.com/ad/client/standard.js"
data-params='{"slot": 1160, "targets": { "category": ["6222", "16158", "274", "17912"]}, "count": 2}'
data-sfcallback='function (response) { return response;}'>
Copy link
Contributor

@torch2424 torch2424 Feb 15, 2019

Choose a reason for hiding this comment

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

Oh also, @aisleypay do you think this is possibly a security issue by allowing the user to embed / run their own JS through an attribute, that is then just run?

cc @lannka @cramforce

Copy link
Author

Choose a reason for hiding this comment

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

Each of our clients have their own CDN. To enable our clients who want to use PromoteIQ on AMP-enabled pages, they have to pass that specific CDN, which includes client specific PromoteIQ logic.

The sfcallback is for client specific rendering. Each client can render an ad in any way they please. Our clients take our responses and render the responses in their desired format. In order for PromoteIQ to work on AMP enabled pages, the ability to allow clients to still use their custom rendering logic is key.

Copy link
Contributor

Choose a reason for hiding this comment

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

@aisleypay Ah, thank you for the reason! That makes sense, but it definitely opens up a lot of security / Developer experience on the AMP side of things. Thus, I think it would be good to get a response from @lannka and/or @cramforce

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting, so you don't mind if the client is manipulating the ads or even fake clicks?

anyway, I don't see a security issue to AMP pages as we are rendering it in an iframe sandbox. It's more ad network's choice.

Copy link
Author

Choose a reason for hiding this comment

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

@lannka Can you clarify what you mean by 'manipulating the ads'?

As far as fake clicks go, we work closely with our clients on inventory implementation - QA and constant monitoring. Impression/click capture and monitoring is part of the PromoteIQ integration process and for the lifetime of our relationship with the client. When we see suspicious behavior we work with our clients to resolve it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got you. I guess you are probably doing more reservation ads, so you don't need to worry about pub modifying the ad contents to have click fraud.

Copy link
Author

Choose a reason for hiding this comment

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

@lannka @torch2424 Indeed! Do either of you have any further questions or concerns per this thread?

</amp-ad>

<h2>PubExchange</h2>
<amp-embed width="640" height="320"
heights="(max-width:480px) 400%, (max-width:650px) 100%, 75%"
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ See [amp-ad rules](https://github.com/ampproject/amphtml/blob/master/extensions/
- [polymorphicAds](../../ads/polymorphicads.md)
- [popin](../../ads/popin.md)
- [Pressboard](../../ads/pressboard.md)
- [PromoteIQ](../../ads/promoteiq.md)
- [PubGuru](../../ads/pubguru.md)
- [PubMatic](../../ads/pubmatic.md)
- [Pubmine](../../ads/pubmine.md)
Expand Down