Skip to content

Commit

Permalink
Browsi RTD : fix for targeting (#10814)
Browse files Browse the repository at this point in the history
* real time data module,
browsi sub module for real time data,
new hook bidsBackCallback,
fix for config unsubscribe

* change timeout&primary ad server only to auctionDelay
update docs

* support multiple providers

* change promise to callbacks
configure submodule on submodules.json

* bug fixes

* use Prebid ajax

* tests fix

* browsi real time data provider improvements

* real time data module,
browsi sub module for real time data,
new hook bidsBackCallback,
fix for config unsubscribe

* change timeout&primary ad server only to auctionDelay
update docs

* support multiple providers

* change promise to callbacks
configure submodule on submodules.json

* bug fixes

* use Prebid ajax

* tests fix

* browsi real time data provider improvements

* browsi-rtd-targeting-fix
  • Loading branch information
omerDotan authored Dec 11, 2023
1 parent b47a38b commit 260269d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/browsiRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export function collectData() {
let predictorData = {
...{
sk: _moduleParams.siteKey,
pk: _moduleParams.pubKey,
sw: (win.screen && win.screen.width) || -1,
sh: (win.screen && win.screen.height) || -1,
url: `${doc.location.protocol}//${doc.location.host}${doc.location.pathname}`,
Expand Down Expand Up @@ -134,7 +135,6 @@ function getRTD(auc) {
const adSlot = getSlotByCode(uc);
const identifier = adSlot ? getMacroId(_browsiData['pmd'], adSlot) : uc;
const _pd = _bp[identifier];
rp[uc] = getKVObject(-1);
if (!_pd) {
return rp
}
Expand Down Expand Up @@ -275,7 +275,7 @@ function getPredictionsFromServer(url) {
if (req.status === 200) {
try {
const data = JSON.parse(response);
if (data && data.p && data.kn) {
if (data) {
setData({p: data.p, kn: data.kn, pmd: data.pmd, bet: data.bet});
} else {
setData({});
Expand Down
6 changes: 0 additions & 6 deletions test/spec/modules/browsiRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ describe('browsi Real time data sub module', function () {
expect(browsiRTD.browsiSubmodule.getTargetingData([], null, null, auction)).to.eql({});
});

it('should return NA if no prediction for ad unit', function () {
makeSlot({code: 'adMock', divId: 'browsiAd_2'});
browsiRTD.setData({});
expect(browsiRTD.browsiSubmodule.getTargetingData(['adMock'], null, null, auction)).to.eql({adMock: {bv: 'NA'}});
});

it('should return prediction from server', function () {
makeSlot({code: 'hasPrediction', divId: 'hasPrediction'});
const data = {
Expand Down

0 comments on commit 260269d

Please sign in to comment.