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

OpenX: CCPA support and force HTTPS requests #6

Open
wants to merge 1 commit into
base: master-v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 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
Expand Down
2 changes: 1 addition & 1 deletion open-x-htb-exports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
shellInterface.OpenXHtb = {
adResponseCallbacks: {},
version: '2.1.2'
version: '2.1.3'
};

//? if(FEATURES.GPT_LINE_ITEMS) {
Expand Down
2 changes: 1 addition & 1 deletion open-x-htb-system-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ 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.2');
expect(request.query.bc).toBe('hb_ix_2.1.3');
expect(request.query.be).toBe('1');
}

Expand Down
15 changes: 10 additions & 5 deletions open-x-htb.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ function OpenXHtb(configs) {
* }}
*/
var gdprConsent = ComplianceService.gdpr.getConsent();
var gdprPrivacyEnabled = ComplianceService.isPrivacyEnabled();
var uspConsent = ComplianceService.usp && ComplianceService.usp.getConsent();
var privacyEnabled = ComplianceService.isPrivacyEnabled();

var tradeDeskId = null;

Expand Down Expand Up @@ -164,14 +165,18 @@ function OpenXHtb(configs) {
queryObj.ttduuid = tradeDeskId;
}

if (gdprPrivacyEnabled) {
if (privacyEnabled) {
if (gdprConsent.consentString !== void(0)) { // eslint-disable-line
queryObj.gdpr_consent = gdprConsent.consentString; // eslint-disable-line
}

if (gdprConsent.applies !== void(0)) { // eslint-disable-line
queryObj.gdpr = gdprConsent.applies ? '1' : '0';
}

if (uspConsent) {
queryObj.us_privacy = uspConsent.uspString; // eslint-disable-line
}
}

return {
Expand Down Expand Up @@ -386,7 +391,7 @@ function OpenXHtb(configs) {
partnerId: 'OpenXHtb',
namespace: 'OpenXHtb',
statsId: 'OPNX',
version: '2.1.2',
version: '2.1.3',
targetingType: 'slot',
enabledAnalytics: {
requestTime: true
Expand Down Expand Up @@ -428,12 +433,12 @@ function OpenXHtb(configs) {
configs.charset = configs.charset || 'UTF-8';
configs.bidderCode = configs.bidderCode || 'hb_ix';

__baseAdRequestUrl = Network.buildUrl(Browser.getProtocol() + '//' + configs.host, [
__baseAdRequestUrl = Network.buildUrl('https://' + configs.host, [
configs.medium,
configs.version,
configs.endPointName
]);
__baseBeaconUrl = Network.buildUrl(Browser.getProtocol() + '//' + configs.host, [
__baseBeaconUrl = Network.buildUrl('https://' + configs.host, [
configs.medium,
configs.version,
'bo'
Expand Down