Skip to content

Commit

Permalink
sending bid placement slot to trion url to be utilized by our endpoin…
Browse files Browse the repository at this point in the history
…t. also utilizing prebid location util function for location
  • Loading branch information
Mike Groh committed May 31, 2017
1 parent 87ed202 commit 2bab824
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/adapters/trion.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ TrionAdapter = function TrionAdapter() {
var pubId = utils.getBidIdParameter('pubId', bid.params);
var sectionId = utils.getBidIdParameter('sectionId', bid.params);
var re = utils.getBidIdParameter('re', bid.params);
var url = window.location.href;
var url = utils.getTopWindowUrl();
var sizes = utils.parseSizesInput(bid.sizes).join(',');

var trionUrl = BID_REQUEST_BASE_URL;

trionUrl = utils.tryAppendQueryString(trionUrl, 'callback', 'pbjs.handleTrionCB');
trionUrl = utils.tryAppendQueryString(trionUrl, 'callback', '$$PREBID_GLOBAL$$.handleTrionCB');
trionUrl = utils.tryAppendQueryString(trionUrl, 'bidId', bidId);
trionUrl = utils.tryAppendQueryString(trionUrl, 'pubId', pubId);
trionUrl = utils.tryAppendQueryString(trionUrl, 'sectionId', sectionId);
trionUrl = utils.tryAppendQueryString(trionUrl, 're', re);
trionUrl = utils.tryAppendQueryString(trionUrl, 'slot', bid.placementCode);
if (url) {
trionUrl += 'url=' + url + '&';
}
Expand Down
4 changes: 3 additions & 1 deletion test/spec/adapters/trion_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import trionAdapter from 'src/adapters/trion';
import bidmanager from 'src/bidmanager';
import * as utils from 'src/utils';
const CONSTANTS = require('src/constants.json');
const adloader = require('src/adloader');

Expand Down Expand Up @@ -107,7 +108,8 @@ describe('Trion adapter tests', () => {

let bidUrl = spyLoadScript.getCall(0).args[0];
expect(bidUrl).to.include('re=1');
expect(bidUrl).to.include(window.location.href);
expect(bidUrl).to.include(utils.getTopWindowUrl());
expect(bidUrl).to.include('slot=' + PLACEMENT_CODE);
delete params.re;
});

Expand Down

0 comments on commit 2bab824

Please sign in to comment.