Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integr8 Bid Adapter : updated endpoint URL #10535

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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