Skip to content

Commit

Permalink
Merge pull request #3 from prebid/master
Browse files Browse the repository at this point in the history
Sync upstream Master
  • Loading branch information
GLStephen authored Sep 2, 2020
2 parents 66d2022 + bb18807 commit c23b8eb
Show file tree
Hide file tree
Showing 21 changed files with 1,239 additions and 529 deletions.
20 changes: 11 additions & 9 deletions modules/ablidaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as utils from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {ajax} from '../src/ajax.js';
import { BANNER, NATIVE } from '../src/mediaTypes.js';

const BIDDER_CODE = 'ablida';
const ENDPOINT_URL = 'https://bidder.ablida.net/prebid';

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, NATIVE],

/**
* Determines whether or not the given bid request is valid.
Expand All @@ -31,20 +32,22 @@ export const spec = {
return [];
}
return validBidRequests.map(bidRequest => {
const sizes = utils.parseSizesInput(bidRequest.sizes)[0];
const size = sizes.split('x');
let sizes = []
if (bidRequest.mediaTypes && bidRequest.mediaTypes[BANNER] && bidRequest.mediaTypes[BANNER].sizes) {
sizes = bidRequest.mediaTypes[BANNER].sizes;
}
const jaySupported = 'atob' in window && 'currentScript' in document;
const device = getDevice();
const payload = {
placementId: bidRequest.params.placementId,
width: size[0],
height: size[1],
sizes: sizes,
bidId: bidRequest.bidId,
categories: bidRequest.params.categories,
referer: bidderRequest.refererInfo.referer,
jaySupported: jaySupported,
device: device,
adapterVersion: 2
adapterVersion: 3,
mediaTypes: bidRequest.mediaTypes
};
return {
method: 'POST',
Expand Down Expand Up @@ -72,9 +75,8 @@ export const spec = {
return bidResponses;
},
onBidWon: function (bid) {
if (!bid['nurl']) { return false; }
ajax(bid['nurl'], null);
return true;
if (!bid['nurl']) { return; }
utils.triggerPixel(bid['nurl']);
}
};

Expand Down
26 changes: 25 additions & 1 deletion modules/ablidaBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@ Module that connects to Ablida's bidder for bids.
}
}
]
}, {
code: 'native-ad-div',
mediaTypes: {
native: {
image: {
sendId: true,
required: true
},
title: {
required: true
},
body: {
required: true
}
}
},
bids: [
{
bidder: 'ablida',
params: {
placementId: 'native-demo'
}
}
]
}
];
];
```
3 changes: 2 additions & 1 deletion modules/atsAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ atsAnalyticsAdapter.enableAnalytics = function (config) {

adaptermanager.registerAnalyticsAdapter({
adapter: atsAnalyticsAdapter,
code: 'atsAnalytics'
code: 'atsAnalytics',
gvlid: 97
});

export default atsAnalyticsAdapter;
3 changes: 1 addition & 2 deletions modules/automatadBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export const spec = {
}

const siteId = validBidRequests[0].params.siteId
const placementId = validBidRequests[0].params.placementId

const impressions = validBidRequests.map(bidRequest => {
return {
id: bidRequest.bidId,
adUnitCode: bidRequest.adUnitCode,
placement: bidRequest.params.placementId,
banner: {
format: bidRequest.sizes.map(sizeArr => ({
w: sizeArr[0],
Expand All @@ -48,7 +48,6 @@ export const spec = {
imp: impressions,
site: {
id: siteId,
placement: placementId,
domain: window.location.hostname,
page: window.location.href,
ref: bidderRequest.refererInfo ? bidderRequest.refererInfo.referer || null : null,
Expand Down
8 changes: 2 additions & 6 deletions modules/consentManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
function v2CmpResponseCallback(tcfData, success) {
utils.logInfo('Received a response from CMP', tcfData);
if (success) {
if (tcfData.gdprApplies === false) {
cmpSuccess(tcfData, hookConfig);
} else if (tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') {
cmpSuccess(tcfData, hookConfig);
} else if (tcfData.eventStatus === 'cmpuishown' && tcfData.tcString && tcfData.purposeOneTreatment === true) {
if (tcfData.gdprApplies === false || tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') {
cmpSuccess(tcfData, hookConfig);
}
} else {
Expand Down Expand Up @@ -225,7 +221,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
window.addEventListener('message', readPostMessageResponse, false);

// call CMP
window[apiName](commandName, null, moduleCallback);
window[apiName](commandName, undefined, moduleCallback);

function readPostMessageResponse(event) {
let cmpDataPkgName = `${apiName}Return`;
Expand Down
Loading

0 comments on commit c23b8eb

Please sign in to comment.