From 62e79bc1b344a7971bd1b113b571ae678c5011f3 Mon Sep 17 00:00:00 2001 From: Sergi Gimenez Date: Wed, 3 Jan 2024 13:59:02 +0100 Subject: [PATCH 01/13] RichaudienceBidAdapter add function onTimeout --- modules/richaudienceBidAdapter.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/richaudienceBidAdapter.js b/modules/richaudienceBidAdapter.js index 1625912ddb8..90aa9455155 100755 --- a/modules/richaudienceBidAdapter.js +++ b/modules/richaudienceBidAdapter.js @@ -183,6 +183,24 @@ export const spec = { } return syncs }, + + onTimeout: function (data) { + let {params, timeout} = data[0] + let url = 'https://s.richaudience.com/err/?ec=6&ev=[timeout_publisher]&pla=[placement_hash]&int=PREBID&pltfm=&node=&dm=[domain]'; + + url = url.replace('[timeout_publisher]', timeout) + url = url.replace('[placement_hash]', params[0].pid) + if (REFERER != null) { + url = url.replace('[domain]', REFERER) + } + + let pixelTimeout = document.createElement('img') + pixelTimeout.id = 'raPix' + pixelTimeout.src = url + pixelTimeout.width = '1px' + pixelTimeout.height = '1px' + document.body.appendChild(pixelTimeout) + } }; registerBidder(spec); From 811206c8d6d03b51aa8d22f6f3fb397d6611066d Mon Sep 17 00:00:00 2001 From: Sergi Gimenez Date: Mon, 8 Jan 2024 10:09:11 +0100 Subject: [PATCH 02/13] Add unit test --- .../gpt/x-domain/creative.html | 2 +- modules/richaudienceBidAdapter.js | 31 +++++++------ .../modules/richaudienceBidAdapter_spec.js | 46 +++++++++++++++++++ 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/integrationExamples/gpt/x-domain/creative.html b/integrationExamples/gpt/x-domain/creative.html index f1c0c647e72..d2c31e967f7 100644 --- a/integrationExamples/gpt/x-domain/creative.html +++ b/integrationExamples/gpt/x-domain/creative.html @@ -2,7 +2,7 @@ // creative will be rendered, e.g. GAM delivering a SafeFrame // this code is autogenerated, also available in 'build/creative/creative.js' - + +