-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from bwschmidt/openx_ccpa
[HTP-103] OpenX: CCPA/USP support and force HTTPS calls
- Loading branch information
Showing
6 changed files
with
891 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* Wed Dec 18 2019 Brian Schmidt <[email protected]> 2.1.3 | ||
- Make all requests secure (SamSite preparedness) | ||
- CCPA Compliance | ||
|
||
* Mon Oct 8 2018 Yunjia Lu <[email protected]> 2.1.2 | ||
- Add trade desk id support | ||
- Clarify private market DFP targeting | ||
- Fix eslint, add general documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# OpenX | ||
## General Compatibility | ||
|Feature| | | ||
|---|---| | ||
| Consent | Y | | ||
| Native Ad Support | | | ||
| SafeFrame Support | | | ||
| PMP Support | Y | | ||
|
||
## Browser Compatibility | ||
| Browser | | | ||
|--- |---| | ||
| Chrome | Y | | ||
| Edge | Y | | ||
| Firefox | Y | | ||
| Internet Explorer 9 | | | ||
| Internet Explorer 10 | Y | | ||
| Internet Explorer 11 | Y | | ||
| Safari | Y | | ||
| Mobile Chrome | Y | | ||
| Mobile Safari | Y | | ||
| UC Browser | | | ||
| Samsung Internet | | | ||
| Opera | | | ||
|
||
## Adapter Information | ||
| Info | | | ||
|---|---| | ||
| Partner Id | OpenXHtb | | ||
| Ad Server Responds in (Cents, Dollars, etc) | 10 cent (a.k.a. 2000 = 2 dollar) | | ||
| Bid Type (Gross / Net) | Net | | ||
| GAM Key (Open Market) | ix_ox_om | | ||
| GAM Key (Private Market) | ix_ox_pm | | ||
| Ad Server URLs | http(s)://valid_host_name/w/1.0/arj? | | ||
| Slot Mapping Sytle (Size / Multiple Sizes / Slot) | Multiple Sizes | | ||
| Request Architecture (MRA / SRA) | SRA | | ||
|
||
## Currencies Supported | ||
|
||
## Bid Request Information | ||
### Parameters | ||
| Key | Required | Type | Description | | ||
|---|---|---|---| | ||
| auid | Y | String | comma(,) separated ad unit ids to request for| | ||
| aus | Y | String | pipe(|) separated sizes for each ad unit in param auid, use comma(,) for multi-size in each ad unit size | | ||
| bc | Y | String | openx adapter version | | ||
| be | Y | Number | 1 for bidder eligibility, 0 for other - this must be set as 1 for header bidding | | ||
|
||
### Example | ||
```javascript | ||
http(s)://valid_host_name/w/1.0/arj?auid=54321%2C12345&aus=300x250%2C300x600%7C300x600&bc=hb_ix_2.1.2&be=1&ju=http%3A%2F%2Flocalhost%3A5837%2Fpublic%2Fdebugger%2Fadapter-debugger.html&jr=http%3A%2F%2Flocalhost%3A5837%2Fpublic%2Fdebugger%2Fadapter-debugger.html&ch=UTF-8&tz=420&res=1440x900&tws=1303x347&ifr=1&callback=window.headertag.OpenXHtb.adResponseCallbacks._Bo02nxzC&cache=1539218162700&gdpr_consent=TEST_GDPR_CONSENT_STRING&gdpr=1 | ||
``` | ||
|
||
## Bid Response Information | ||
### Bid Example | ||
```javascript | ||
{ | ||
ads: { | ||
ad: [ | ||
{ | ||
adunitid: 54321, | ||
pub_rev: '100', | ||
html: '<div>creative content<div>', | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '250' | ||
} | ||
] | ||
}, | ||
{ | ||
adunitid: 12345, | ||
pub_rev: '200', | ||
html: '<div>creative content<div>', | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '600' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
### Pass Example | ||
```javascript | ||
{ | ||
ads: { | ||
ad: [] | ||
} | ||
} | ||
``` | ||
|
||
## Configuration Information | ||
### Configuration Keys | ||
| Key | Required | Type | Description | | ||
|---|---|---|---| | ||
| host | Y | String | OpenX delivery domain for each publisher | | ||
| adUnitId | Y | String | the ad server ad unit identifier | | ||
| sizes | Y | Array[] | an array of array representation of the size of the ad unit, like [width, height] | | ||
### Example | ||
```javascript | ||
{ | ||
host: '<valid host>', // The required partner-level property. | ||
xSlots: { // All the ad slot-level properties under the `xSlots` property. | ||
1: { | ||
adUnitId: '54321', | ||
sizes: [[300, 250]] | ||
}, | ||
2: { | ||
adUnitId: '12345', | ||
sizes: [[300, 250], [300, 600]] | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
shellInterface.OpenXHtb = { | ||
adResponseCallbacks: {}, | ||
version: '2.1.3' | ||
}; | ||
|
||
//? if(FEATURES.GPT_LINE_ITEMS) { | ||
shellInterface.OpenXHtb.render = SpaceCamp.services.RenderService.renderDfpAd.bind(null, 'OpenXHtb'); | ||
|
||
/* Backwards-compatible alternate function name */ | ||
shellInterface.OpenXModule = { | ||
render: shellInterface.OpenXHtb.render | ||
}; | ||
//? } | ||
|
||
if (__directInterface.Layers.PartnersLayer.Partners.OpenXHtb) { | ||
shellInterface.OpenXHtb = shellInterface.OpenXHtb || {}; | ||
shellInterface.OpenXHtb.adResponseCallbacks = __directInterface.Layers.PartnersLayer.Partners.OpenXHtb.adResponseCallbacks; | ||
shellInterface.OpenXHtb.version = __directInterface.Layers.PartnersLayer.Partners.OpenXHtb.version; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
'use strict'; | ||
|
||
function getPartnerId() { | ||
return 'OpenXHtb'; | ||
} | ||
|
||
function getStatsId() { | ||
return 'OPNX'; | ||
} | ||
|
||
function getCallbackType() { | ||
return 'NAME'; | ||
} | ||
|
||
function getArchitecture() { | ||
return 'SRA'; | ||
} | ||
|
||
function getConfig() { | ||
return { | ||
host: 'mock-ox-del-domain.openx.net', | ||
xSlots: { | ||
1: { | ||
adUnitId: '54321', | ||
sizes: [[300, 250], [300, 600]] | ||
}, | ||
2: { | ||
adUnitId: '12345', | ||
sizes: [[300, 600]] | ||
} | ||
} | ||
}; | ||
} | ||
|
||
function getBidRequestRegex() { | ||
return { | ||
method: 'GET', | ||
urlRegex: /.*openx\.net\/w\/1\.0\/arj\?.*/ | ||
}; | ||
} | ||
|
||
function validateBidRequest(request) { | ||
// Check query string parameters. | ||
expect(request.query.auid).toBe('54321,12345'); | ||
expect(request.query.aus).toBe('300x250,300x600|300x600'); | ||
expect(request.query.bc).toBe('hb_ix_2.1.3'); | ||
expect(request.query.be).toBe('1'); | ||
} | ||
|
||
function getValidResponse(request, creative) { | ||
var adm = creative || '<a target="_blank" href="http://www.indexexchange.com"><div style="text-decoration: none; color: black; width: 300px; height:250px;background-color: #336eff;"; id="testDiv"><h1><header_tag> certification testing: 1_1a1a1a1a, deal: 12346 (211474080)width: 300px; height:250px <iframe src="http://as.casalemedia.com/ifnotify?dfp_1_1a1a1a1a&referer=http://127.0.0.1:3000/p/DfpAuto/nonPrefetch/test?dev=desktop&displayMode=SRA&req=211474080" width="0" height="0" frameborder="0" scrolling="no" style="display:none;" marginheight="0" marginwidth="0"></iframe></h1></div><script>var thisDiv = document.getElementById("testDiv");thisDiv.style.fontFamily="verdana";</script></a>'; | ||
var response = { | ||
ads: { | ||
ad: [ | ||
{ | ||
adunitid: 54321, | ||
pub_rev: '1000', | ||
html: adm, | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '250' | ||
} | ||
] | ||
}, | ||
{ | ||
adunitid: 12345, | ||
pub_rev: '2000', | ||
html: adm, | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '600' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
|
||
return request.query.callback + '(' + JSON.stringify(response) + ')'; | ||
} | ||
|
||
function validateTargeting(targetingMap) { | ||
expect(targetingMap).toEqual(jasmine.objectContaining({ | ||
ix_ox_om: jasmine.arrayContaining(['300x250_100', '300x600_200']), | ||
ix_ox_id: jasmine.arrayContaining([jasmine.any(String)]) | ||
})); | ||
} | ||
|
||
function getPassResponse(request) { | ||
var response = { | ||
ads: { | ||
ad: [] | ||
} | ||
}; | ||
|
||
return request.query.callback + '(' + JSON.stringify(response) + ')'; | ||
} | ||
|
||
function getValidResponseWithDeal(request, creative) { | ||
var adm = creative || '<a target="_blank" href="http://www.indexexchange.com"><div style="text-decoration: none; color: black; width: 300px; height:250px;background-color: #336eff;"; id="testDiv"><h1><header_tag> certification testing: 1_1a1a1a1a, deal: 12346 (211474080)width: 300px; height:250px <iframe src="http://as.casalemedia.com/ifnotify?dfp_1_1a1a1a1a&referer=http://127.0.0.1:3000/p/DfpAuto/nonPrefetch/test?dev=desktop&displayMode=SRA&req=211474080" width="0" height="0" frameborder="0" scrolling="no" style="display:none;" marginheight="0" marginwidth="0"></iframe></h1></div><script>var thisDiv = document.getElementById("testDiv");thisDiv.style.fontFamily="verdana";</script></a>'; | ||
var response = { | ||
ads: { | ||
ad: [ | ||
{ | ||
adunitid: 54321, | ||
pub_rev: '100', | ||
html: adm, | ||
deal_id: 1, | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '250' | ||
} | ||
] | ||
}, | ||
{ | ||
adunitid: 12345, | ||
pub_rev: '200', | ||
html: adm, | ||
deal_id: 2, | ||
creative: [ | ||
{ | ||
width: '300', | ||
height: '600' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
|
||
return request.query.callback + '(' + JSON.stringify(response) + ')'; | ||
} | ||
|
||
function validateTargetingWithDeal(targetingMap) { | ||
expect(targetingMap).toEqual(jasmine.objectContaining({ | ||
ix_ox_pm: jasmine.arrayContaining(['300x250_1', '300x600_2']), | ||
ix_ox_id: jasmine.arrayContaining([jasmine.any(String)]) | ||
})); | ||
} | ||
|
||
module.exports = { | ||
getPartnerId: getPartnerId, | ||
getStatsId: getStatsId, | ||
getBidRequestRegex: getBidRequestRegex, | ||
getCallbackType: getCallbackType, | ||
getConfig: getConfig, | ||
validateBidRequest: validateBidRequest, | ||
getValidResponse: getValidResponse, | ||
validateTargeting: validateTargeting, | ||
getArchitecture: getArchitecture, | ||
getPassResponse: getPassResponse, | ||
getValidResponseWithDeal: getValidResponseWithDeal, | ||
validateTargetingWithDeal: validateTargetingWithDeal | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* @author: Partner | ||
* @license: UNLICENSED | ||
* | ||
* @copyright: Copyright (c) 2017 by Index Exchange. All rights reserved. | ||
* | ||
* The information contained within this document is confidential, copyrighted | ||
* and or a trade secret. No part of this document may be reproduced or | ||
* distributed in any form or by any means, in whole or in part, without the | ||
* prior written permission of Index Exchange. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Dependencies //////////////////////////////////////////////////////////////// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
var Inspector = require('../../../libs/external/schema-inspector.js'); | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Main //////////////////////////////////////////////////////////////////////// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
function partnerValidator(configs) { | ||
var result = Inspector.validate({ | ||
type: 'object', | ||
properties: { | ||
host: { | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
medium: { | ||
optional: true, | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
version: { | ||
optional: true, | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
endPointName: { | ||
optional: true, | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
charset: { | ||
optional: true, | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
xSlots: { | ||
type: 'object', | ||
properties: { | ||
'*': { | ||
type: 'object', | ||
properties: { | ||
adUnitId: { | ||
type: 'string', | ||
minLength: 1 | ||
}, | ||
sizes: { | ||
type: 'array', | ||
minLength: 1, | ||
items: { | ||
type: 'array', | ||
exactLength: 2, | ||
items: { | ||
type: 'integer', | ||
gte: 0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, configs); | ||
|
||
if (!result.valid) { | ||
return result.format(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
module.exports = partnerValidator; |
Oops, something went wrong.