From f1a9455465ba7c66d37be67b3eaa734e4254cdbe Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Wed, 18 Aug 2021 16:12:33 +0200 Subject: [PATCH 01/10] tappx: upate adapter version --- modules/tappxBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 927d60277cd..e6a6e85bf89 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -8,7 +8,7 @@ import { config } from '../src/config.js'; const BIDDER_CODE = 'tappx'; const TTL = 360; const CUR = 'USD'; -const TAPPX_BIDDER_VERSION = '0.1.10714'; +const TAPPX_BIDDER_VERSION = '0.1.100818'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; const VIDEO_SUPPORT = ['instream']; From 1ec3ee5883a310697ac94ba21cb50aeea371d577 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Wed, 18 Aug 2021 16:13:39 +0200 Subject: [PATCH 02/10] tappx: add outstream to video support context --- modules/tappxBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index e6a6e85bf89..3245927e300 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -11,7 +11,7 @@ const CUR = 'USD'; const TAPPX_BIDDER_VERSION = '0.1.100818'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; -const VIDEO_SUPPORT = ['instream']; +const VIDEO_SUPPORT = ['instream', 'outstream']; const DATA_TYPES = { 'NUMBER': 'number', @@ -163,7 +163,7 @@ function validMediaType(bid) { // Video validations if (typeof video != 'undefined') { if (VIDEO_SUPPORT.indexOf(video.context) === -1) { - utils.logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Only "instream" is suported.'); + utils.logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Video context not supported.'); return false; } if (typeof video.mimes == 'undefined') { From cd8f04e288397438eab9b3e632b6ddebb1406563 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Wed, 18 Aug 2021 16:14:21 +0200 Subject: [PATCH 03/10] tappx: outstream with adnxs player --- modules/tappxBidAdapter.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 3245927e300..1a92cbbdeb4 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -4,6 +4,7 @@ import * as utils from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; +import { Renderer } from '../src/Renderer.js'; const BIDDER_CODE = 'tappx'; const TTL = 360; @@ -12,6 +13,7 @@ const TAPPX_BIDDER_VERSION = '0.1.100818'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; const VIDEO_SUPPORT = ['instream', 'outstream']; +const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js'; const DATA_TYPES = { 'NUMBER': 'number', @@ -200,6 +202,12 @@ function interpretBid(serverBid, request) { bidReturned.vastUrl = serverBid.lurl; bidReturned.ad = serverBid.adm; bidReturned.mediaType = VIDEO; + bidReturned.width = serverBid.w; + bidReturned.height = serverBid.h; + + if (request.bids.mediaTypes.video.context === 'outstream') { + bidReturned.renderer = createRenderer(bidReturned, request); + } } else { bidReturned.ad = serverBid.adm; bidReturned.mediaType = BANNER; @@ -230,6 +238,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { const BIDEXTRA = utils.deepAccess(validBidRequests, 'params.ext'); const bannerMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.banner'); const videoMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.video'); + // const { refererInfo } = bidderRequest; // let requests = []; let payload = {}; @@ -469,6 +478,35 @@ export function _getHostInfo(validBidRequests) { return domainInfo; } +function outstreamRender(bid, request) { + bid.renderer.push(() => { + window.ANOutstreamVideo.renderAd({ + sizes: [bid.width, bid.height], + targetId: bid.adUnitCode, + adResponse: bid.adResponse, + rendererOptions: { + content: bid.vastXml + } + }); + }); +} + +function createRenderer(bid, request) { + const rendererInst = Renderer.install({ + id: request.bids.adUnitCode, + url: RENDERER_URL, + loaded: false + }); + + try { + rendererInst.setRender(outstreamRender); + } catch (err) { + utils.logWarn(LOG_PREFIX, 'Prebid Error calling setRender on renderer'); + } + + return rendererInst; +} + export function _checkParamDataType(key, value, datatype) { var errMsg = 'Ignoring param key: ' + key + ', expects ' + datatype + ', found ' + typeof value; var functionToExecute; From 6f41f8bd0937114b12f010cdcb408eb1536ae78f Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Wed, 18 Aug 2021 16:32:16 +0200 Subject: [PATCH 04/10] tappx: add external tappx renderer --- modules/tappxBidAdapter.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 1a92cbbdeb4..7e326040210 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -13,7 +13,6 @@ const TAPPX_BIDDER_VERSION = '0.1.100818'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; const VIDEO_SUPPORT = ['instream', 'outstream']; -const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js'; const DATA_TYPES = { 'NUMBER': 'number', @@ -206,7 +205,12 @@ function interpretBid(serverBid, request) { bidReturned.height = serverBid.h; if (request.bids.mediaTypes.video.context === 'outstream') { - bidReturned.renderer = createRenderer(bidReturned, request); + const url = (serverBid.ext.purl) ? serverBid.ext.purl : false; + if (!url) { + utils.logWarn(LOG_PREFIX, 'Error getting player'); + return false; + } + bidReturned.renderer = createRenderer(bidReturned, request, url); } } else { bidReturned.ad = serverBid.adm; @@ -238,7 +242,6 @@ function buildOneRequest(validBidRequests, bidderRequest) { const BIDEXTRA = utils.deepAccess(validBidRequests, 'params.ext'); const bannerMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.banner'); const videoMediaType = utils.deepAccess(validBidRequests, 'mediaTypes.video'); - // const { refererInfo } = bidderRequest; // let requests = []; let payload = {}; @@ -419,6 +422,10 @@ function buildOneRequest(validBidRequests, bidderRequest) { payloadExt.bidder.mktag = MKTAG; payloadExt.bidder.bcid = utils.deepAccess(validBidRequests, 'params.bcid'); payloadExt.bidder.bcrid = utils.deepAccess(validBidRequests, 'params.bcrid'); + payloadExt.bidder.ext = (typeof BIDEXTRA == 'object') ? BIDEXTRA : {}; + if (videoMediaType.context) { + payloadExt.bidder.ext.pbvidtype = videoMediaType.context + } // < Payload Ext // > Payload @@ -480,7 +487,7 @@ export function _getHostInfo(validBidRequests) { function outstreamRender(bid, request) { bid.renderer.push(() => { - window.ANOutstreamVideo.renderAd({ + window.tappxOutstream.renderAd({ sizes: [bid.width, bid.height], targetId: bid.adUnitCode, adResponse: bid.adResponse, @@ -491,10 +498,10 @@ function outstreamRender(bid, request) { }); } -function createRenderer(bid, request) { +function createRenderer(bid, request, url) { const rendererInst = Renderer.install({ - id: request.bids.adUnitCode, - url: RENDERER_URL, + id: request.id, + url: url, loaded: false }); From 58f424081be53975f511bd4ab418b0f63e44cd29 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Wed, 18 Aug 2021 16:42:07 +0200 Subject: [PATCH 05/10] tappx: update md description --- modules/tappxBidAdapter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tappxBidAdapter.md b/modules/tappxBidAdapter.md index f98b996c52a..677718c261c 100644 --- a/modules/tappxBidAdapter.md +++ b/modules/tappxBidAdapter.md @@ -7,7 +7,7 @@ Maintainer: prebid@tappx.com # Description Module that connects to :tappx demand sources. -Suppots Banner and Instream Video. +Suppots Banner and Video (instream and outstream). Please use ```tappx``` as the bidder code. Ads sizes available: [300,250], [320,50], [320,480], [480,320], [728,90], [768,1024], [1024,768] @@ -55,7 +55,7 @@ Ads sizes available: [300,250], [320,50], [320,480], [480,320], [728,90], [768,1 }, mediaTypes: { video: { - context: "instream", + context: %CONTEXT%, // Could be "instream" or "outstream" mimes : [ "video/mp4", "application/javascript" ], playerSize: [320, 250] } From 971cd3b0c3d0574d8586f294d7a22f809ca3ce5b Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Thu, 19 Aug 2021 12:05:37 +0200 Subject: [PATCH 06/10] tappx :: improve null control, log text, --- modules/tappxBidAdapter.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 7e326040210..af4fd3f5eb7 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -162,7 +162,7 @@ function validMediaType(bid) { const video = utils.deepAccess(bid, 'mediaTypes.video'); // Video validations - if (typeof video != 'undefined') { + if (typeof video !== 'undefined') { if (VIDEO_SUPPORT.indexOf(video.context) === -1) { utils.logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Video context not supported.'); return false; @@ -194,9 +194,9 @@ function interpretBid(serverBid, request) { netRevenue: true, } - if (typeof serverBid.dealId != 'undefined') { bidReturned.dealId = serverBid.dealId } + if (typeof serverBid.dealId !== 'undefined') { bidReturned.dealId = serverBid.dealId } - if (typeof request.bids.mediaTypes != 'undefined' && typeof request.bids.mediaTypes.video != 'undefined') { + if (typeof request.bids.mediaTypes !== 'undefined' && typeof request.bids.mediaTypes.video !== 'undefined') { bidReturned.vastXml = serverBid.adm; bidReturned.vastUrl = serverBid.lurl; bidReturned.ad = serverBid.adm; @@ -206,8 +206,8 @@ function interpretBid(serverBid, request) { if (request.bids.mediaTypes.video.context === 'outstream') { const url = (serverBid.ext.purl) ? serverBid.ext.purl : false; - if (!url) { - utils.logWarn(LOG_PREFIX, 'Error getting player'); + if (typeof url !== 'undefined') { + utils.logWarn(LOG_PREFIX, 'Error getting the tappx outstream player'); return false; } bidReturned.renderer = createRenderer(bidReturned, request, url); @@ -217,7 +217,7 @@ function interpretBid(serverBid, request) { bidReturned.mediaType = BANNER; } - if (typeof bidReturned.adomain != 'undefined' || bidReturned.adomain != null) { + if (typeof bidReturned.adomain !== 'undefined' || bidReturned.adomain !== null) { bidReturned.meta = { advertiserDomains: request.bids.adomain }; } @@ -302,7 +302,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { imp.banner = banner; } - if (videoMediaType) { + if (typeof videoMediaType !== 'undefined') { let video = {}; let videoParams = utils.deepAccess(validBidRequests, 'params.video'); @@ -423,8 +423,8 @@ function buildOneRequest(validBidRequests, bidderRequest) { payloadExt.bidder.bcid = utils.deepAccess(validBidRequests, 'params.bcid'); payloadExt.bidder.bcrid = utils.deepAccess(validBidRequests, 'params.bcrid'); payloadExt.bidder.ext = (typeof BIDEXTRA == 'object') ? BIDEXTRA : {}; - if (videoMediaType.context) { - payloadExt.bidder.ext.pbvidtype = videoMediaType.context + if (typeof videoMediaType !== 'undefined') { + payloadExt.bidder.ext.pbvidtype = videoMediaType.context; } // < Payload Ext @@ -442,7 +442,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { payload.regs = regs; // < Payload - let pbjsv = ($$PREBID_GLOBAL$$.version != null) ? encodeURIComponent($$PREBID_GLOBAL$$.version) : -1; + let pbjsv = ($$PREBID_GLOBAL$$.version !== null) ? encodeURIComponent($$PREBID_GLOBAL$$.version) : -1; return { method: 'POST', From 3e0fc46ab79eb983d60ecf531a9402cd33c4ee56 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Thu, 19 Aug 2021 12:06:29 +0200 Subject: [PATCH 07/10] tappx: test - update valid bid for video outstream --- test/spec/modules/tappxBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index c4e0329de17..e436625d4fe 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -167,11 +167,11 @@ describe('Tappx bid adapter', function () { assert.isFalse(spec.isBidRequestValid(badBidRequest_mimes.bids), badBidRequest_mimes); }); - it('should return false for not instream requests', function () { + it('should return false for not instream/outstream requests', function () { let badBidRequest_v = c_BIDDERREQUEST_V; delete badBidRequest_v.bids.mediaTypes.banner; badBidRequest_v.bids.mediaTypes.video = {}; - badBidRequest_v.bids.mediaTypes.video.context = 'outstream'; + badBidRequest_v.bids.mediaTypes.video.context = ''; badBidRequest_v.bids.mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; badBidRequest_v.bids.mediaTypes.video.playerSize = [320, 250]; assert.isFalse(spec.isBidRequestValid(badBidRequest_v.bids)); From 80cbd0cffc46e5252788fe2e4fa1a9c94963ab47 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Thu, 19 Aug 2021 16:53:39 +0200 Subject: [PATCH 08/10] tappx: fix issue obtaining url player --- modules/tappxBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index af4fd3f5eb7..6224ea10e12 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -206,8 +206,8 @@ function interpretBid(serverBid, request) { if (request.bids.mediaTypes.video.context === 'outstream') { const url = (serverBid.ext.purl) ? serverBid.ext.purl : false; - if (typeof url !== 'undefined') { - utils.logWarn(LOG_PREFIX, 'Error getting the tappx outstream player'); + if (typeof url === 'undefined') { + utils.logWarn(LOG_PREFIX, 'Error getting player outstream from tappx'); return false; } bidReturned.renderer = createRenderer(bidReturned, request, url); From cf37e263ed2fac81ef56ff2582b4843843b3dd99 Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Fri, 20 Aug 2021 08:43:36 +0200 Subject: [PATCH 09/10] tappx: test - update for video --- test/spec/modules/tappxBidAdapter_spec.js | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index e436625d4fe..123379eb29e 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -117,6 +117,7 @@ const c_VALIDBIDREQUESTS = [{'bidder': 'tappx', 'params': {'host': 'testing.ssp. const c_VALIDBIDAPPREQUESTS = [{'bidder': 'tappx', 'params': {'host': 'testing.ssp.tappx.com\/rtb\/v2\/', 'tappxkey': 'pub-1234-android-1234', 'endpoint': 'ZZ1234PBJS', 'bidfloor': 0.005, 'test': 1, 'app': {'name': 'Tappx Test', 'bundle': 'com.test.tappx', 'domain': 'tappx.com', 'publisher': { 'name': 'Tappx', 'domain': 'tappx.com' }}}, 'userId': {'haloId': '0000fgclxw05ycn0608xiyi90bwpa0c0evvlif0hv1x0i0ku88il0ntek0o0qskvir0trr70u0wqxiix0zq3u1012pa5j315ogh1618nmsj91bmt41c1elzfjf1hl5r1i1kkc2jl', 'id5id': {'uid': 'ID5@iu-PJX_OQ0d6FJjKS8kYfUpHriD_qpoXJUngedfpNva812If1fHEqHHkamLC89txVxk1i9WGqeQrTX97HFCgv9QDa1M_bkHUBsAWFm-D5r1rYrsfMFFiyqwCAEzqNbvsUZXOYCAQSjPcLxR4of22w-U9_JDRThCGRDV3Fmvc38E', 'ext': {'linkType': 0}}, 'intentIqId': 'GIF89a\u0001\u0000\u0001\u0000�\u0000\u0000���\u0000\u0000\u0000!�\u0004\u0001\u0000\u0000\u0000\u0000,\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0002\u0002D\u0001\u0000;', 'lotamePanoramaId': '8003916b61a95b185690ec103bdf4945a70213e01818a5e5d8690b542730755a', 'parrableId': {'eid': '01.1617088921.7faa68d9570a50ea8e4f359e9b99ca4b7509e948a6175b3e5b0b8cbaf5b62424104ccfb0191ca79366de8368ed267b89a68e236df5f41f96f238e4301659e9023fec05e46399fb1ad0a0'}, 'pubcid': 'b7143795-852f-42f0-8864-5ecbea1ade4e', 'pubProvidedId': [{'source': 'domain.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 1, 'ext': {'stype': 'ppuid'}}]}, {'source': '3rdpartyprovided.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 3, 'ext': {'stype': 'sha256email'}}]}]}, 'userIdAsEids': [{'source': 'audigent.com', 'uids': [{'id': '0000fgclxw05ycn0608xiyi90bwpa0c0evvlif0hv1x0i0ku88il0ntek0o0qskvir0trr70u0wqxiix0zq3u1012pa5j315ogh1618nmsj91bmt41c1elzfjf1hl5r1i1kkc2jl', 'atype': 1}]}, {'source': 'id5-sync.com', 'uids': [{'id': 'ID5@iu-PJX_OQ0d6FJjKS8kYfUpHriD_qpoXJUngedfpNva812If1fHEqHHkamLC89txVxk1i9WGqeQrTX97HFCgv9QDa1M_bkHUBsAWFm-D5r1rYrsfMFFiyqwCAEzqNbvsUZXOYCAQSjPcLxR4of22w-U9_JDRThCGRDV3Fmvc38E', 'atype': 1, 'ext': {'linkType': 0}}]}, {'source': 'intentiq.com', 'uids': [{'id': 'GIF89a\u0001\u0000\u0001\u0000�\u0000\u0000���\u0000\u0000\u0000!�\u0004\u0001\u0000\u0000\u0000\u0000,\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0002\u0002D\u0001\u0000;', 'atype': 1}]}, {'source': 'crwdcntrl.net', 'uids': [{'id': '8003916b61a95b185690ec103bdf4945a70213e01818a5e5d8690b542730755a', 'atype': 1}]}, {'source': 'parrable.com', 'uids': [{'id': '01.1617088921.7faa68d9570a50ea8e4f359e9b99ca4b7509e948a6175b3e5b0b8cbaf5b62424104ccfb0191ca79366de8368ed267b89a68e236df5f41f96f238e4301659e9023fec05e46399fb1ad0a0', 'atype': 1}]}, {'source': 'pubcid.org', 'uids': [{'id': 'b7143795-852f-42f0-8864-5ecbea1ade4e', 'atype': 1}]}, {'source': 'domain.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 1, 'ext': {'stype': 'ppuid'}}]}, {'source': '3rdpartyprovided.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 3, 'ext': {'stype': 'sha256email'}}]}], 'ortb2Imp': {'ext': {'data': {'adserver': {'name': 'gam', 'adslot': '/19968336/header-bid-tag-0'}, 'pbadslot': '/19968336/header-bid-tag-0'}}}, 'mediaTypes': {'banner': {'sizes': [[320, 480], [320, 50]]}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'transactionId': '71c0d86b-4b47-4aff-a6da-1af0b1712439', 'sizes': [[320, 480], [320, 50]], 'bidId': '264d7969b125a5', 'bidderRequestId': '1c674c14a3889c', 'auctionId': '13a8a3a9-ed3a-4101-9435-4699ee77bb62', 'src': 'client', 'bidRequestsCount': 1, 'bidderRequestsCount': 1, 'bidderWinsCount': 0}]; const c_BIDDERREQUEST_B = {'bidderCode': 'tappx', 'auctionId': '13a8a3a9-ed3a-4101-9435-4699ee77bb62', 'bidderRequestId': '1c674c14a3889c', 'bids': [{'bidder': 'tappx', 'params': {'host': 'testing.ssp.tappx.com\/rtb\/v2\/', 'tappxkey': 'pub-1234-android-1234', 'endpoint': 'ZZ1234PBJS', 'bidfloor': 0.005, 'test': 1}, 'userId': {'haloId': '0000fgclxw05ycn0608xiyi90bwpa0c0evvlif0hv1x0i0ku88il0ntek0o0qskvir0trr70u0wqxiix0zq3u1012pa5j315ogh1618nmsj91bmt41c1elzfjf1hl5r1i1kkc2jl', 'id5id': {'uid': 'ID5@iu-PJX_OQ0d6FJjKS8kYfUpHriD_qpoXJUngedfpNva812If1fHEqHHkamLC89txVxk1i9WGqeQrTX97HFCgv9QDa1M_bkHUBsAWFm-D5r1rYrsfMFFiyqwCAEzqNbvsUZXOYCAQSjPcLxR4of22w-U9_JDRThCGRDV3Fmvc38E', 'ext': {'linkType': 0}}, 'intentIqId': 'GIF89a\u0000\u0000\u0000\u0000�\u0000\u0000���\u0000\u0000\u0000?�\u0000\u0000\u0000\u0000\u0000\u0000,\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000A\u0000\u0000;', 'lotamePanoramaId': '8003916b61a95b185690ec103bdf4945a70213e01818a5e5d8690b542730755a', 'parrableId': {'eid': '01.1617088921.7faa68d9570a50ea8e4f359e9b99ca4b7509e948a6175b3e5b0b8cbaf5b62424104ccfb0191ca79366de8368ed267b89a68e236df5f41f96f238e4301659e9023fec05e46399fb1ad0a0'}, 'pubcid': 'b7143795-852f-42f0-8864-5ecbea1ade4e', 'pubProvidedId': [{'source': 'domain.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 1, 'ext': {'stype': 'ppuid'}}]}, {'source': '3rdpartyprovided.com', 'uids': [{'id': 'value read from cookie or local storage', 'atype': 3, 'ext': {'stype': 'sha256email'}}]}]}, 'userIdAsEids': [{'source': 'audigent.com', 'uids': [{'id': '0000fgclxw05ycn0608xiyi90bwpa0c0evvlif0hv1x0i0ku88il0ntek0o0qskvir0trr70u0wqxiix0zq3u1012pa5j315ogh1618nmsj91bmt41c1elzfjf1hl5r1i1kkc2jl', 'atype': 1}]}, {'source': 'id5-sync.com', 'uids': [{'id': 'ID5@iu-PJX_OQ0d6FJjKS8kYfUpHriD_qpoXJUngedfpNva812If1fHEqHHkamLC89txVxk1i9WGqeQrTX97HFCgv9QDa1M_bkHUBsAWFm-D5r1rYrsfMFFiyqwCAEzqNbvsUZXOYCAQSjPcLxR4of22w-U9_JDRThCGRDV3Fmvc38E', 'atype': 1, 'ext': {'linkType': 0}}]}], 'ortb2Imp': {'ext': {'data': {'adserver': {'name': 'gam', 'adslot': '/19968336/header-bid-tag-0'}, 'pbadslot': '/19968336/header-bid-tag-0'}}}, 'mediaTypes': {'banner': {'sizes': [[320, 480], [320, 50]]}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'transactionId': '71c0d86b-4b47-4aff-a6da-1af0b1712439', 'sizes': [[320, 480], [320, 50]], 'bidId': '264d7969b125a5', 'bidderRequestId': '1c674c14a3889c', 'auctionId': '13a8a3a9-ed3a-4101-9435-4699ee77bb62', 'src': 'client', 'bidRequestsCount': 1, 'bidderRequestsCount': 1, 'bidderWinsCount': 0}], 'auctionStart': 1617088922120, 'timeout': 700, 'refererInfo': {'referer': 'http://localhost:9999/integrationExamples/gpt/gdpr_hello_world.html?pbjs_debug=true', 'reachedTop': true, 'isAmp': false, 'numIframes': 0, 'stack': ['http://localhost:9999/integrationExamples/gpt/gdpr_hello_world.html?pbjs_debug=true'], 'canonicalUrl': null}, 'gdprConsent': {'consentString': c_CONSENTSTRING, 'vendorData': {'metadata': 'BO-JeiTPABAOkAAABAENABA', 'gdprApplies': true, 'hasGlobalScope': false, 'cookieVersion': 1, 'created': '2020-12-09T09:22:09.900Z', 'lastUpdated': '2021-01-14T15:44:03.600Z', 'cmpId': 0, 'cmpVersion': 1, 'consentScreen': 0, 'consentLanguage': 'EN', 'vendorListVersion': 1, 'maxVendorId': 0, 'purposeConsents': {}, 'vendorConsents': {}}, 'gdprApplies': true, 'apiVersion': 1}, 'uspConsent': '1YCC', 'start': 1611308859099}; const c_BIDDERREQUEST_V = {'method': 'POST', 'url': 'https://testing.ssp.tappx.com/rtb/v2//VZ12TESTCTV?type_cnn=prebidjs&v=0.1.10329', 'data': '{"site":{"name":"localhost","bundle":"localhost","domain":"localhost"},"user":{"ext":{}},"id":"0fecfa84-c541-49f8-8c45-76b90fddc30e","test":1,"at":1,"tmax":1000,"bidder":"tappx","imp":[{"video":{"mimes":["video/mp4","application/javascript"],"minduration":3,"maxduration":30,"startdelay":5,"playbackmethod":[1,3],"api":[1,2],"protocols":[2,3],"battr":[13,14],"linearity":1,"placement":2,"minbitrate":10,"maxbitrate":10,"w":320,"h":250},"id":"2398241a5a860b","tagid":"localhost_typeAdBanVid_windows","secure":1,"bidfloor":0.005,"ext":{"bidder":{"tappxkey":"pub-1234-desktop-1234","endpoint":"vz34906po","host":"https://vz34906po.pub.tappx.com/rtb/","bidfloor":0.005}}}],"device":{"os":"windows","ip":"peer","ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","h":864,"w":1536,"dnt":0,"language":"en","make":"Google Inc."},"params":{"host":"tappx.com","bidfloor":0.005},"regs":{"gdpr":0,"ext":{}}}', 'bids': {'bidder': 'tappx', 'params': {'host': 'testing.ssp.tappx.com/rtb/v2/', 'tappxkey': 'pub-1234-desktop-1234', 'endpoint': 'VZ12TESTCTV', 'bidfloor': 0.005, 'test': true}, 'crumbs': {'pubcid': 'dccfe922-3823-4676-b7b2-e5ed8743154e'}, 'ortb2Imp': {'ext': {'data': {'pbadslot': 'video-ad-div'}}}, 'renderer': {'options': {'text': 'Tappx Outstream Video'}}, 'mediaTypes': {'video': {'mimes': ['video/mp4', 'application/javascript'], 'minduration': 3, 'maxduration': 30, 'startdelay': 5, 'playbackmethod': [1, 3], 'api': [1, 2], 'protocols': [2, 3], 'battr': [13, 14], 'linearity': 1, 'placement': 2, 'minbitrate': 10, 'maxbitrate': 10, 'w': 320, 'h': 250}}, 'adUnitCode': 'video-ad-div', 'transactionId': 'ed41c805-d14c-49c3-954d-26b98b2aa2c2', 'sizes': [[320, 250]], 'bidId': '28f49c71b13f2f', 'bidderRequestId': '1401710496dc7', 'auctionId': 'e807363f-3095-43a8-a4a6-f44196cb7318', 'src': 'client', 'bidRequestsCount': 1, 'bidderRequestsCount': 1, 'bidderWinsCount': 0}} +const c_BIDDERREQUEST_VOutstream = {'method': 'POST', 'url': 'https://testing.ssp.tappx.com/rtb/v2//VZ12TESTCTV?type_cnn=prebidjs&v=0.1.10329', 'data': '{"site":{"name":"localhost","bundle":"localhost","domain":"localhost"},"user":{"ext":{}},"id":"0fecfa84-c541-49f8-8c45-76b90fddc30e","test":1,"at":1,"tmax":1000,"bidder":"tappx","imp":[{"video":{"context": "outstream","playerSize":[640, 480],"mimes":["video/mp4","application/javascript"],"minduration":3,"maxduration":30,"startdelay":5,"playbackmethod":[1,3],"api":[1,2],"protocols":[2,3],"battr":[13,14],"linearity":1,"placement":2,"minbitrate":10,"maxbitrate":10,"w":320,"h":250},"id":"2398241a5a860b","tagid":"localhost_typeAdBanVid_windows","secure":1,"bidfloor":0.005,"ext":{"bidder":{"tappxkey":"pub-1234-desktop-1234","endpoint":"vz34906po","host":"https://vz34906po.pub.tappx.com/rtb/","bidfloor":0.005}}}],"device":{"os":"windows","ip":"peer","ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","h":864,"w":1536,"dnt":0,"language":"en","make":"Google Inc."},"params":{"host":"tappx.com","bidfloor":0.005},"regs":{"gdpr":0,"ext":{}}}', 'bids': {'bidder': 'tappx', 'params': {'host': 'testing.ssp.tappx.com/rtb/v2/', 'tappxkey': 'pub-1234-desktop-1234', 'endpoint': 'VZ12TESTCTV', 'bidfloor': 0.005, 'test': true}, 'crumbs': {'pubcid': 'dccfe922-3823-4676-b7b2-e5ed8743154e'}, 'ortb2Imp': {'ext': {'data': {'pbadslot': 'video-ad-div'}}}, 'renderer': {'options': {'text': 'Tappx Outstream Video'}}, 'mediaTypes': {'video': {'mimes': ['video/mp4', 'application/javascript'], 'minduration': 3, 'maxduration': 30, 'startdelay': 5, 'playbackmethod': [1, 3], 'api': [1, 2], 'protocols': [2, 3], 'battr': [13, 14], 'linearity': 1, 'placement': 2, 'minbitrate': 10, 'maxbitrate': 10, 'w': 320, 'h': 250}}, 'adUnitCode': 'video-ad-div', 'transactionId': 'ed41c805-d14c-49c3-954d-26b98b2aa2c2', 'sizes': [[320, 250]], 'bidId': '28f49c71b13f2f', 'bidderRequestId': '1401710496dc7', 'auctionId': 'e807363f-3095-43a8-a4a6-f44196cb7318', 'src': 'client', 'bidRequestsCount': 1, 'bidderRequestsCount': 1, 'bidderWinsCount': 0}} describe('Tappx bid adapter', function () { /** @@ -185,11 +186,13 @@ describe('Tappx bid adapter', function () { // Web Test let validBidRequests = c_VALIDBIDREQUESTS; let validBidRequests_V = c_VALIDBIDREQUESTS; + let validBidRequests_Voutstream = c_VALIDBIDREQUESTS; // App Test let validAppBidRequests = c_VALIDBIDAPPREQUESTS; let bidderRequest = c_BIDDERREQUEST_B; let bidderRequest_V = c_BIDDERREQUEST_V; + let bidderRequest_VOutstream = c_BIDDERREQUEST_VOutstream; it('should add gdpr/usp consent information to the request', function () { const request = spec.buildRequests(validBidRequests, bidderRequest); @@ -215,6 +218,14 @@ describe('Tappx bid adapter', function () { }); it('should properly build a video request', function () { + delete validBidRequests_V[0].mediaTypes.banner + validBidRequests_V[0].mediaTypes.video = {}; + validBidRequests_V[0].mediaTypes.video.playerSize = [640, 480]; + validBidRequests_V[0].mediaTypes.video.context = 'instream'; + validBidRequests_V[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; + + bidderRequest_V.bids.mediaTypes.context = 'instream'; + const request = spec.buildRequests(validBidRequests_V, bidderRequest_V); expect(request[0].url).to.match(/^(http|https):\/\/(.*)\.tappx\.com\/.+/); expect(request[0].method).to.equal('POST'); @@ -223,9 +234,27 @@ describe('Tappx bid adapter', function () { expect(data.site).to.not.equal(null); expect(data.imp).to.have.lengthOf(1); expect(data.imp[0].bidfloor, data).to.not.be.null; - expect(data.imp[0].banner).to.not.equal(null); - expect(data.imp[0].banner.w).to.be.oneOf([320, 50, 250, 480]); - expect(data.imp[0].banner.h).to.be.oneOf([320, 50, 250, 480]); + expect(data.imp[0].video).to.not.equal(null); + }); + + it('should properly build a video outstream request', function () { + delete validBidRequests_Voutstream[0].mediaTypes.banner + validBidRequests_Voutstream[0].mediaTypes.video = {}; + validBidRequests_Voutstream[0].mediaTypes.video.playerSize = [640, 480]; + validBidRequests_Voutstream[0].mediaTypes.video.context = 'outstream'; + validBidRequests_Voutstream[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; + + bidderRequest_VOutstream.bids.mediaTypes.context = 'outstream'; + + const request = spec.buildRequests(validBidRequests_Voutstream, bidderRequest_VOutstream); + expect(request[0].url).to.match(/^(http|https):\/\/(.*)\.tappx\.com\/.+/); + expect(request[0].method).to.equal('POST'); + + const data = JSON.parse(request[0].data); + expect(data.site).to.not.equal(null); + expect(data.imp).to.have.lengthOf(1); + expect(data.imp[0].bidfloor, data).to.not.be.null; + expect(data.imp[0].video).to.not.equal(null); }); it('should set user eids array', function () { From 276ff02fa404288b61002995d0fd412990f92c5c Mon Sep 17 00:00:00 2001 From: marc_tappx Date: Fri, 20 Aug 2021 11:20:17 +0200 Subject: [PATCH 10/10] tappx: fix adapter version --- modules/tappxBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 6224ea10e12..97acf929cde 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -9,7 +9,7 @@ import { Renderer } from '../src/Renderer.js'; const BIDDER_CODE = 'tappx'; const TTL = 360; const CUR = 'USD'; -const TAPPX_BIDDER_VERSION = '0.1.100818'; +const TAPPX_BIDDER_VERSION = '0.1.0818'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; const VIDEO_SUPPORT = ['instream', 'outstream'];