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

Impactify Bid Adapter : Removing checks on bid request #10769

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3c2be25
Remove use of local storage
thomasdseao Jul 15, 2022
353f399
Update impactifyBidAdapter.js
thomasdseao Jul 15, 2022
86c38be
Merge branch 'prebid:master' into master
thomasdseao Sep 7, 2022
cce3531
Merge branch 'prebid:master' into master
thomasdseao Oct 7, 2022
39638eb
Add differents mediatypes to Impactify bidder
timpactifyo91 Oct 14, 2022
321b142
Add differents mediatypes to Impactify bidder
thomasdseao Oct 20, 2022
eb91d30
Add differents mediatypes to Impactify bidder
thomasdseao Oct 20, 2022
63049a7
Add format parameter for banner
thomasdseao Oct 21, 2022
749ae94
add getFloor
thomasdseao Nov 28, 2022
1d787e5
add getFloor
thomasdseao Nov 30, 2022
2a4f279
add getFloor
thomasdseao Dec 1, 2022
4ce79d2
add parsing of local storage
Sep 29, 2023
ab9db7f
delete unused var
Oct 2, 2023
228e6f1
fix spacing with import
Oct 2, 2023
498d4b4
Add local storage key management
thomasdseao Oct 11, 2023
11fe4d6
Merge pull request #5 from Impactify-AdTech/feature/local_storage
thomasdseao Oct 11, 2023
8e35a4d
Merge branch 'master' into feature/impactify
thomasdseao Oct 11, 2023
8838edd
Merge pull request #2 from Impactify-AdTech/feature/impactify
thomasdseao Oct 11, 2023
27f4d31
Adjustments
thomasdseao Oct 12, 2023
439b8ea
Fix eids object
thomasdseao Oct 26, 2023
d73ab69
Fix eids object
thomasdseao Oct 26, 2023
a081529
Fix eids object
thomasdseao Oct 26, 2023
1120cf2
Fix tests
thomasdseao Oct 27, 2023
576f727
Merge branch 'prebid:master' into master
thomasdseao Nov 22, 2023
0ec9e73
Remove check on the request banner size parameter
thomasdseao Nov 28, 2023
bdaca3d
Few adjustments
thomasdseao Nov 28, 2023
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
26 changes: 9 additions & 17 deletions modules/impactifyBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AUCTION_URI = '/bidder';
const COOKIE_SYNC_URI = '/static/cookie_sync.html';
const GVL_ID = 606;
const GET_CONFIG = config.getConfig;
export const STORAGE = getStorageManager({gvlid: GVL_ID, bidderCode: BIDDER_CODE});
export const STORAGE = getStorageManager({ gvlid: GVL_ID, bidderCode: BIDDER_CODE });
export const STORAGE_KEY = '_im_str'

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ function createOpenRtbRequest(validBidRequests, bidderRequest) {
validBidRequests,
cur: [DEFAULT_CURRENCY],
imp: [],
source: {tid: bidderRequest.ortb2?.source?.tid}
source: { tid: bidderRequest.ortb2?.source?.tid }
};

// Get the url parameters
Expand Down Expand Up @@ -149,7 +149,7 @@ function createOpenRtbRequest(validBidRequests, bidderRequest) {
dnt: (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0,
language: ((navigator.language || navigator.userLanguage || '').split('-'))[0] || 'en',
};
request.site = {page: bidderRequest.refererInfo.page};
request.site = { page: bidderRequest.refererInfo.page };

// Handle privacy settings for GDPR/CCPA/COPPA
let gdprApplies = 0;
Expand All @@ -176,24 +176,21 @@ function createOpenRtbRequest(validBidRequests, bidderRequest) {
// Create imps with bids
validBidRequests.forEach((bid) => {
let bannerObj = deepAccess(bid.mediaTypes, `banner`);
let videoObj = deepAccess(bid.mediaTypes, `video`);

let imp = {
id: bid.bidId,
bidfloor: bid.params.bidfloor ? bid.params.bidfloor : 0,
ext: helpers.getExtParamsFromBid(bid)
};

if (videoObj) {
imp.video = {
...helpers.createOrtbImpVideoObj(bid)
}
}

if (bannerObj && typeof imp.ext.impactify.size == 'string') {
imp.banner = {
...helpers.createOrtbImpBannerObj(bid, imp.ext.impactify.size)
}
} else {
imp.video = {
...helpers.createOrtbImpVideoObj(bid)
}
}

if (typeof bid.getFloor === 'function') {
Expand Down Expand Up @@ -227,8 +224,6 @@ export const spec = {
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
let isBanner = deepAccess(bid.mediaTypes, `banner`);

if (typeof bid.params.appId != 'string' || !bid.params.appId) {
return false;
}
Expand All @@ -241,9 +236,6 @@ export const spec = {
if (bid.params.style !== 'inline' && bid.params.style !== 'impact' && bid.params.style !== 'static') {
return false;
}
if (isBanner && (typeof bid.params.size != 'string' || !bid.params.size.includes('x') || bid.params.size.split('x').length != 2)) {
return false;
}

return true;
},
Expand Down Expand Up @@ -369,7 +361,7 @@ export const spec = {
* Register bidder specific code, which will execute if a bid from this bidder won the auction
* @param {Bid} The bid that won the auction
*/
onBidWon: function(bid) {
onBidWon: function (bid) {
ajax(`${LOGGER_URI}/prebid/won`, null, JSON.stringify(bid), {
method: 'POST',
contentType: 'application/json'
Expand All @@ -382,7 +374,7 @@ export const spec = {
* Register bidder specific code, which will execute if bidder timed out after an auction
* @param {data} Containing timeout specific data
*/
onTimeout: function(data) {
onTimeout: function (data) {
ajax(`${LOGGER_URI}/prebid/timeout`, null, JSON.stringify(data[0]), {
method: 'POST',
contentType: 'application/json'
Expand Down
15 changes: 7 additions & 8 deletions test/spec/modules/impactifyBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ImpactifyAdapter', function () {
localStorageIsEnabledStub = sandbox.stub(STORAGE, 'localStorageIsEnabled');
});

afterEach(function() {
afterEach(function () {
$$PREBID_GLOBAL$$.bidderSettings = {};
document.body.appendChild.restore();
sandbox.restore();
Expand All @@ -57,7 +57,6 @@ describe('ImpactifyAdapter', function () {
params: {
appId: 'example.com',
format: 'display',
size: '728x90',
style: 'static'
}
}
Expand Down Expand Up @@ -282,7 +281,7 @@ describe('ImpactifyAdapter', function () {
};

it('should pass bidfloor', function () {
videoBidRequests[0].getFloor = function() {
videoBidRequests[0].getFloor = function () {
return {
currency: 'USD',
floor: 1.23,
Expand Down Expand Up @@ -342,7 +341,7 @@ describe('ImpactifyAdapter', function () {
h: 1,
hash: 'test',
expiry: 166192938,
meta: {'advertiserDomains': ['testdomain.com']},
meta: { 'advertiserDomains': ['testdomain.com'] },
ext: {
prebid: {
'type': 'video'
Expand Down Expand Up @@ -418,7 +417,7 @@ describe('ImpactifyAdapter', function () {
height: 1,
hash: 'test',
expiry: 166192938,
meta: {'advertiserDomains': ['testdomain.com']},
meta: { 'advertiserDomains': ['testdomain.com'] },
ttl: 300,
creativeId: '97517771'
}
Expand Down Expand Up @@ -480,7 +479,7 @@ describe('ImpactifyAdapter', function () {
h: 1,
hash: 'test',
expiry: 166192938,
meta: {'advertiserDomains': ['testdomain.com']},
meta: { 'advertiserDomains': ['testdomain.com'] },
ext: {
prebid: {
'type': 'video'
Expand Down Expand Up @@ -536,8 +535,8 @@ describe('ImpactifyAdapter', function () {
const result = spec.getUserSyncs('bad', [], gdprData);
expect(result).to.be.empty;
});
it('should append the various values if they exist', function() {
const result = spec.getUserSyncs({iframeEnabled: true}, validResponse, gdprData);
it('should append the various values if they exist', function () {
const result = spec.getUserSyncs({ iframeEnabled: true }, validResponse, gdprData);
expect(result[0].url).to.include('gdpr=1');
expect(result[0].url).to.include('gdpr_consent=BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA');
});
Expand Down