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

docereeAdManager Bid Adapter : updated bid adapter #12333

Merged
merged 32 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3479745
Updated docereeAdManager bid adapter
lokesh-doceree Jul 12, 2024
ef90cd9
Updated docereeAdManager bid adapter
lokesh-doceree Jul 16, 2024
54c51cf
Merge branch 'prebid:master' into master
Doceree-techStack Jul 16, 2024
370a6b6
Updated docereeAdManager bid adapter
lokesh-doceree Jul 16, 2024
a2877d2
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 16, 2024
d640f5e
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
616cf80
Merge branch 'prebid:master' into master
Doceree-techStack Jul 17, 2024
dd7011c
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
0e7c161
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 17, 2024
e97c816
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
4960002
Update docereeAdManagerBidAdapter.js
patmmccann Jul 19, 2024
71297ec
added test cases for payload formation in DocereeAdManager
lokesh-doceree Jul 23, 2024
72dbdfd
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 23, 2024
43799bc
Added support for publisherUrl
lokesh-doceree Aug 2, 2024
660e80e
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Aug 2, 2024
456f1c3
added some parameters
lokesh-doceree Aug 5, 2024
629439e
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Aug 5, 2024
f89f4e8
Merge branch 'prebid:master' into master
Doceree-techStack Sep 3, 2024
3d3a84f
Added support for TCF 2.2
lokesh-doceree Sep 11, 2024
8870881
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Sep 11, 2024
b99ae6f
Merge branch 'prebid:master' into master
Doceree-techStack Sep 11, 2024
1bdd721
Merge branch 'prebid:master' into master
Doceree-techStack Oct 15, 2024
e771a0a
Update docereeAdManagerBidAdapter.js
lokesh-doceree Oct 16, 2024
706e3dc
Update docereeAdManagerBidAdapter.js
lokesh-doceree Oct 17, 2024
bf764cf
Update docereeAdManagerBidAdapter.js
lokesh-doceree Oct 17, 2024
34da539
Written test cases for new method implemented.
lokesh-doceree Oct 22, 2024
5be8f58
Merge branch 'prebid:master' into master
Doceree-techStack Oct 22, 2024
1baa3bc
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Oct 22, 2024
49312cb
indentation issues resolved
lokesh-doceree Oct 22, 2024
3503ec0
Update docereeAdManagerBidAdapter_spec.js
lokesh-doceree Oct 22, 2024
614306e
Update docereeAdManagerBidAdapter_spec.js
lokesh-doceree Oct 22, 2024
2b1bcfd
Update docereeAdManagerBidAdapter_spec.js
lokesh-doceree Oct 22, 2024
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
12 changes: 11 additions & 1 deletion modules/docereeAdManagerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,20 @@ export const spec = {
},
};

export function getPageUrl() {
let url = '';
try {
url = window.location.href;
} catch (error) {
}
return url;
}

export function getPayload(bid, userData, bidderRequest) {
if (!userData || !bid) {
return false;
}

const { bidId, params } = bid;
const { placementId, publisherUrl } = params;
const {
Expand Down Expand Up @@ -121,7 +131,7 @@ export function getPayload(bid, userData, bidderRequest) {
dob: dob || '',
userconsent: 1,
mobile: mobile || '',
pageurl: publisherUrl || ''
pageurl: publisherUrl || getPageUrl() || ''
};

try {
Expand Down
17 changes: 13 additions & 4 deletions test/spec/modules/docereeAdManagerBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { spec, getPayload } from '../../../modules/docereeAdManagerBidAdapter.js';
import { spec, getPayload, getPageUrl } from '../../../modules/docereeAdManagerBidAdapter.js';
import { config } from '../../../src/config.js';
import * as utils from '../../../src/utils.js';

describe('docereeadmanager', function () {
config.setConfig({
Expand Down Expand Up @@ -125,8 +126,15 @@ describe('docereeadmanager', function () {
});
});

describe('payload', function() {
it('should return payload with the correct data', function() {
describe('getPageUrl', function () {
it('should return an url string', function () {
const result = getPageUrl();
expect(result).to.equal(utils.getWindowSelf().location.href);
});
});

describe('payload', function () {
it('should return payload with the correct data', function () {
const data = {
userId: 'xxxxx',
email: 'xxxx@mail.com',
Expand All @@ -148,14 +156,15 @@ describe('docereeadmanager', function () {
platformUid: 'Xx.xxx.xxxxxx',
mobile: 'XXXXXXXXXX',
}
bid = {...bid, params: {...bid.params, placementId: 'DOC-19-1'}}
bid = { ...bid, params: { ...bid.params, placementId: 'DOC-19-1' } }
const buildRequests = {
gdprConsent: {
consentString: 'COwK6gaOwK6gaFmAAAENAPCAAAAAAAAAAAAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
gdprApplies: false
}
}
const payload = getPayload(bid, data, buildRequests);

const payloadData = payload.data;
expect(payloadData).to.have.all.keys(
'userid',
Expand Down