Skip to content

Commit

Permalink
Vidazoo Bid Adapter: send page query params to server (prebid#8715)
Browse files Browse the repository at this point in the history
* feat(module): multi size request

* fix getUserSyncs
added tests

* update(module): package-lock.json from master

* feat(module): VidazooBidAdapter - send top query params to server

Co-authored-by: roman <shmoop207@gmail.com>
  • Loading branch information
2 people authored and jorgeluisrocha committed May 18, 2023
1 parent 5e04f77 commit d179e19
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/vidazooBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _each, deepAccess, parseSizesInput } from '../src/utils.js';
import { _each, deepAccess, parseSizesInput, parseUrl } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';
import { getStorageManager } from '../src/storageManager.js';
Expand All @@ -23,7 +23,16 @@ export const SUPPORTED_ID_SYSTEMS = {
'pubcid': 1,
'tdid': 1,
};
const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
const storage = getStorageManager({ gvlid: GVLID, bidderCode: BIDDER_CODE });

function getTopWindowQueryParams() {
try {
const parsedUrl = parseUrl(window.top.document.URL, { decodeSearchAsString: true });
return parsedUrl.search;
} catch (e) {
return '';
}
}

export function createDomain(subDomain = DEFAULT_SUB_DOMAIN) {
return `https://${subDomain}.cootlogix.com`;
Expand Down Expand Up @@ -59,6 +68,7 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest) {

let data = {
url: encodeURIComponent(topWindowUrl),
uqs: getTopWindowQueryParams(),
cb: Date.now(),
bidFloor: bidFloor,
bidId: bidId,
Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ const REQUEST = {
}
};

function getTopWindowQueryParams() {
try {
const parsedUrl = utils.parseUrl(window.top.document.URL, { decodeSearchAsString: true });
return parsedUrl.search;
} catch (e) {
return '';
}
}

describe('VidazooBidAdapter', function () {
describe('validtae spec', function () {
it('exists and is a function', function () {
Expand Down Expand Up @@ -171,6 +180,7 @@ describe('VidazooBidAdapter', function () {
prebidVersion: version,
schain: BID.schain,
res: `${window.top.screen.width}x${window.top.screen.height}`,
uqs: getTopWindowQueryParams(),
'ext.param1': 'loremipsum',
'ext.param2': 'dolorsitamet',
}
Expand Down

0 comments on commit d179e19

Please sign in to comment.