diff --git a/modules/freewheel-sspBidAdapter.js b/modules/freewheel-sspBidAdapter.js
index 38973f915b6..764e3d6e6c0 100644
--- a/modules/freewheel-sspBidAdapter.js
+++ b/modules/freewheel-sspBidAdapter.js
@@ -78,6 +78,39 @@ function getPricing(xmlNode) {
return princingData;
}
+/*
+* Read the StickyBrand extension with this format:
+*
+*
+*
+*
+*
+*
+* @return {object} pricing data in format: {currency: "EUR", price:"1.000"}
+*/
+function getAdvertiserDomain(xmlNode) {
+ var domain = [];
+ var brandExtNode;
+ var extensions = xmlNode.querySelectorAll('Extension');
+ // Nodelist.forEach is not supported in IE and Edge
+ // Workaround given here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10638731/
+ Array.prototype.forEach.call(extensions, function(node) {
+ if (node.getAttribute('type') === 'StickyBrand') {
+ brandExtNode = node;
+ }
+ });
+
+ // Currently we only return one Domain
+ if (brandExtNode) {
+ var domainNode = brandExtNode.querySelector('Domain');
+ domain.push(domainNode.textContent || domainNode.innerText);
+ } else {
+ logWarn('PREBID - ' + BIDDER_CODE + ': No bid received or missing StickyBrand extension.');
+ }
+
+ return domain;
+}
+
function hashcode(inputString) {
var hash = 0;
var char;
@@ -260,7 +293,7 @@ var getOutstreamScript = function(bid) {
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO],
- aliases: ['stickyadstv'], // former name for freewheel-ssp
+ aliases: ['stickyadstv', 'freewheelssp'], // aliases for freewheel-ssp
/**
* Determines whether or not the given bid request is valid.
*
@@ -326,7 +359,7 @@ export const spec = {
}
}
}
- // TODO: is 'page' the right value here?
+
var location = bidderRequest?.refererInfo?.page;
if (isValidUrl(location)) {
requestParams.loc = location;
@@ -409,6 +442,8 @@ export const spec = {
const campaignId = getCampaignId(xmlDoc);
const bannerId = getBannerId(xmlDoc);
const topWin = getTopMostWindow();
+ const advertiserDomains = getAdvertiserDomain(xmlDoc);
+
if (!topWin.freewheelssp_cache) {
topWin.freewheelssp_cache = {};
}
@@ -426,7 +461,7 @@ export const spec = {
currency: princingData.currency,
netRevenue: true,
ttl: 360,
- meta: { advertiserDomains: princingData.adomain && isArray(princingData.adomain) ? princingData.adomain : [] },
+ meta: { advertiserDomains: advertiserDomains },
dealId: dealId,
campaignId: campaignId,
bannerId: bannerId
@@ -454,14 +489,20 @@ export const spec = {
}
}
+ const syncs = [];
if (syncOptions && syncOptions.pixelEnabled) {
- return [{
+ syncs.push({
type: 'image',
url: USER_SYNC_URL + gdprParams
- }];
- } else {
- return [];
+ });
+ } else if (syncOptions.iframeEnabled) {
+ syncs.push({
+ type: 'iframe',
+ url: USER_SYNC_URL + gdprParams
+ });
}
+
+ return syncs;
},
};
diff --git a/modules/freewheel-sspBidAdapter.md b/modules/freewheel-sspBidAdapter.md
index 0086aac6567..a445280f2b0 100644
--- a/modules/freewheel-sspBidAdapter.md
+++ b/modules/freewheel-sspBidAdapter.md
@@ -22,7 +22,7 @@ Module that connects to Freewheel ssp's demand sources
bids: [
{
- bidder: "freewheel-ssp",
+ bidder: "freewheelssp", // or use alias "freewheel-ssp"
params: {
zoneId : '277225'
}
diff --git a/test/spec/modules/freewheel-sspBidAdapter_spec.js b/test/spec/modules/freewheel-sspBidAdapter_spec.js
index 81f4ecec074..7ef576fc7ec 100644
--- a/test/spec/modules/freewheel-sspBidAdapter_spec.js
+++ b/test/spec/modules/freewheel-sspBidAdapter_spec.js
@@ -483,6 +483,23 @@ describe('freewheelSSP BidAdapter Test', () => {
'bidId': '2',
'bidderRequestId': '3',
'auctionId': '4',
+ },
+ {
+ 'bidder': 'freewheelssp',
+ 'params': {
+ 'zoneId': '277225',
+ 'format': 'test'
+ },
+ 'adUnitCode': 'adunit-code',
+ 'mediaTypes': {
+ 'video': {
+ 'playerSize': [300, 600],
+ }
+ },
+ 'sizes': [[300, 400]],
+ 'bidId': '2',
+ 'bidderRequestId': '3',
+ 'auctionId': '4',
}
];
@@ -510,7 +527,8 @@ describe('freewheelSSP BidAdapter Test', () => {
' ' +
' ' +
' 0.2000' +
- ' ' +
+ ' ' +
+ ' ' +
' ' +
' ' +
'';
@@ -536,12 +554,15 @@ describe('freewheelSSP BidAdapter Test', () => {
bannerId: '12345',
vastXml: response,
mediaType: 'video',
- ad: ad
+ ad: ad,
+ meta: {
+ advertiserDomains: 'minotaur.com'
+ }
}
];
let result = spec.interpretResponse(response, request[0]);
- expect(result[0].meta.advertiserDomains).to.deep.equal([]);
+ expect(result[0].meta.advertiserDomains).to.deep.equal(['minotaur.com']);
expect(result[0].dealId).to.equal('NRJ-PRO-00008');
expect(result[0].campaignId).to.equal('SMF-WOW-55555');
expect(result[0].bannerId).to.equal('12345');
@@ -570,7 +591,7 @@ describe('freewheelSSP BidAdapter Test', () => {
];
let result = spec.interpretResponse(response, request[0]);
- expect(result[0].meta.advertiserDomains).to.deep.equal([]);
+ expect(result[0].meta.advertiserDomains).to.deep.equal(['minotaur.com']);
expect(result[0].dealId).to.equal('NRJ-PRO-00008');
expect(result[0].campaignId).to.equal('SMF-WOW-55555');
expect(result[0].bannerId).to.equal('12345');