Skip to content

Commit

Permalink
Invibes Bid Adapter : change referrer formatting (prebid#10017)
Browse files Browse the repository at this point in the history
* Update invibesBidAdapter.js

Removed cutoff of url parameters from location param.

* Update invibesBidAdapter_spec.js

add unit test for cut off location

* Update invibesBidAdapter_spec.js

updated unit tests to do a better check on location href

* changed the way InvibesBidAdapter gets the page location.

* Update invibesBidAdapter.js

simplified the fetching of the page url

* Update invibesBidAdapter.js

remove unused config library

* updated invibes unit tests to accomodate the new page url fetching method
  • Loading branch information
mihaisandu07 authored and Santiago Carabone committed Aug 22, 2023
1 parent 988e108 commit d39ae79
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 37 deletions.
10 changes: 5 additions & 5 deletions modules/invibesBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logInfo } from '../src/utils.js';
import {logInfo} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {getStorageManager} from '../src/storageManager.js';

Expand All @@ -9,7 +9,7 @@ const CONSTANTS = {
SYNC_ENDPOINT: 'https://k.r66net.com/GetUserSync',
TIME_TO_LIVE: 300,
DEFAULT_CURRENCY: 'EUR',
PREBID_VERSION: 9,
PREBID_VERSION: 10,
METHOD: 'GET',
INVIBES_VENDOR_ID: 436,
USERID_PROVIDERS: ['pubcid', 'pubProvidedId', 'uid2', 'zeotapIdPlus', 'id5id'],
Expand Down Expand Up @@ -116,7 +116,7 @@ function buildRequest(bidRequests, bidderRequest) {
bidParamsJson.userId = userIdModel;
}
let data = {
location: getDocumentLocation(topWin),
location: getDocumentLocation(bidderRequest),
videoAdHtmlId: generateRandomId(),
showFallback: currentQueryStringParams['advs'] === '0',
ivbsCampIdsLocal: readFromLocalStorage('IvbsCampIdsLocal'),
Expand Down Expand Up @@ -371,8 +371,8 @@ function generateRandomId() {
return (Math.round(Math.random() * 1e12)).toString(36).substring(0, 10);
}

function getDocumentLocation(topWin) {
return topWin.location.href.substring(0, 300).split(/[?#]/)[0];
function getDocumentLocation(bidderRequest) {
return bidderRequest.refererInfo.page.substring(0, 300);
}

function getUserIds(bidUserId) {
Expand Down
Loading

0 comments on commit d39ae79

Please sign in to comment.