Skip to content

Commit

Permalink
Integr8 Bid Adapter : updated endpoint URL (#10535)
Browse files Browse the repository at this point in the history
* Integr8 Bid Adapter changes

* Change property/placement ids to correct ones
  • Loading branch information
ZikaMyhedin authored Sep 26, 2023
1 parent 0c7b14d commit 93bf6ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
16 changes: 12 additions & 4 deletions modules/integr8BidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { getStorageManager } from '../src/storageManager.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';

const BIDDER_CODE = 'integr8';
const ENDPOINT_URL = 'https://integr8.central.gjirafa.tech/bid';
const DEFAULT_ENDPOINT_URL = 'https://central.sea.integr8.digital/bid';
const DIMENSION_SEPARATOR = 'x';
const SIZE_SEPARATOR = ';';
const BISKO_ID = 'biskoId';
const BISKO_ID = 'integr8Id';
const STORAGE_ID = 'bisko-sid';
const SEGMENTS = 'biskoSegments';
const SEGMENTS = 'integr8Segments';
const storage = getStorageManager({bidderCode: BIDDER_CODE});

export const spec = {
Expand All @@ -31,6 +31,7 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function (validBidRequests, bidderRequest) {
let deliveryUrl = '';
const storageId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(STORAGE_ID) || '' : '';
const biskoId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(BISKO_ID) || '' : '';
const segments = storage.localStorageIsEnabled() ? JSON.parse(storage.getDataFromLocalStorage(SEGMENTS)) || [] : [];
Expand All @@ -55,6 +56,9 @@ export const spec = {
if (!pageViewGuid) { pageViewGuid = bidRequest.params.pageViewGuid || ''; }
if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; }
if (!Object.keys(data).length && bidRequest.params.data && Object.keys(bidRequest.params.data).length) { data = bidRequest.params.data; }
if (!deliveryUrl && bidRequest.params && typeof bidRequest.params.deliveryUrl === 'string') {
deliveryUrl = bidRequest.params.deliveryUrl;
}

return {
sizes: generateSizeParam(bidRequest.sizes),
Expand All @@ -67,6 +71,10 @@ export const spec = {
};
});

if (!deliveryUrl) {
deliveryUrl = DEFAULT_ENDPOINT_URL;
}

let body = {
propertyId: propertyId,
pageViewGuid: pageViewGuid,
Expand All @@ -82,7 +90,7 @@ export const spec = {

return [{
method: 'POST',
url: ENDPOINT_URL,
url: deliveryUrl,
data: body
}];
},
Expand Down
12 changes: 7 additions & 5 deletions modules/integr8BidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Module Name: Integr8 Bidder Adapter Module

Type: Bidder Adapter

Maintainer: arditb@gjirafa.com
Maintainer: myhedin@gjirafa.com

# Description
Integr8 Bidder Adapter for Prebid.js.
Expand All @@ -23,8 +23,9 @@ var adUnits = [
bids: [{
bidder: 'integr8',
params: {
propertyId: '105109', //Required
placementId: '846835', //Required
propertyId: '105135', //Required
placementId: '846837', //Required,
deliveryUrl: 'https://central.sea.integr8.digital/bid', //Optional
data: { //Optional
catalogs: [{
catalogId: "699229",
Expand All @@ -48,8 +49,9 @@ var adUnits = [
bids: [{
bidder: 'integr8',
params: {
propertyId: '105109', //Required
placementId: '846830', //Required
propertyId: '105135', //Required
placementId: '846835', //Required,
deliveryUrl: 'https://central.sea.integr8.digital/bid', //Optional
data: { //Optional
catalogs: [{
catalogId: "699229",
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/integr8BidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('integr8AdapterTest', () => {
});

it('bidRequest url', () => {
const endpointUrl = 'https://integr8.central.gjirafa.tech/bid';
const endpointUrl = 'https://central.sea.integr8.digital/bid';
const requests = spec.buildRequests(bidRequests);
requests.forEach(function (requestItem) {
expect(requestItem.url).to.match(new RegExp(`${endpointUrl}`));
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('integr8AdapterTest', () => {
describe('interpretResponse', () => {
const bidRequest = {
'method': 'POST',
'url': 'https://integr8.central.gjirafa.tech/bid',
'url': 'https://central.sea.integr8.digital/bid',
'data': {
'sizes': '728x90',
'adUnitId': 'hb-leaderboard',
Expand Down

0 comments on commit 93bf6ef

Please sign in to comment.