Skip to content

Commit 238eb2d

Browse files
authored
MobkoiBidAdapter MobkoiIdSystem update: Replace bidRequest.{}.userId with userIdAdEids for 10.0 Compliance (#13397)
* fix(mobkoiId): correct consent object parameter in getId function * deprecate bidrequest.{}.userId and replaced with eids * follow ORTB2.6 standard for eids field * fixed unit test
1 parent 3845a2b commit 238eb2d

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

modules/mobkoiBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const converter = ortbConverter({
2929
deepSetValue(ortbRequest, 'site.publisher.ext.adServerBaseUrl', utils.getAdServerEndpointBaseUrl(prebidBidRequest));
3030
// We only support one impression per request.
3131
deepSetValue(ortbRequest, 'imp.0.tagid', utils.getPlacementId(prebidBidRequest));
32-
deepSetValue(ortbRequest, 'user.id', context.bidRequests[0].userId?.mobkoiId || null);
32+
deepSetValue(ortbRequest, 'user.eids', context.bidRequests[0].userIdAsEids || []);
3333

3434
return ortbRequest;
3535
},

modules/mobkoiIdSystem.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const mobkoiIdSubmodule = {
3131
return value ? { [MODULE_NAME]: value } : undefined;
3232
},
3333

34-
getId(userSyncOptions, gdprConsent) {
34+
getId(userSyncOptions, consentObject) {
3535
logInfo('Getting Equativ SAS ID.');
3636

3737
if (!storage.cookiesAreEnabled()) {
@@ -62,7 +62,7 @@ export const mobkoiIdSubmodule = {
6262
return new Promise((resolve, _reject) => {
6363
utils.requestEquativSasId(
6464
userSyncOptions,
65-
gdprConsent,
65+
consentObject,
6666
(sasId) => {
6767
if (!sasId) {
6868
logError('Equativ SAS ID is empty');
@@ -80,18 +80,24 @@ export const mobkoiIdSubmodule = {
8080
}
8181
};
8282
},
83+
eids: {
84+
'mobkoiId': {
85+
source: 'mobkoi.com',
86+
atype: 1
87+
},
88+
}
8389
};
8490

8591
submodule('userId', mobkoiIdSubmodule);
8692

8793
export const utils = {
88-
requestEquativSasId(syncUserOptions, gdprConsent, onCompleteCallback) {
94+
requestEquativSasId(syncUserOptions, consentObject, onCompleteCallback) {
8995
logInfo('Start requesting Equativ SAS ID');
9096
const adServerBaseUrl = deepAccess(
9197
syncUserOptions,
9298
`params.${PARAM_NAME_AD_SERVER_BASE_URL}`) || PROD_AD_SERVER_BASE_URL;
9399

94-
const equativPixelUrl = utils.buildEquativPixelUrl(syncUserOptions, gdprConsent);
100+
const equativPixelUrl = utils.buildEquativPixelUrl(syncUserOptions, consentObject);
95101
logInfo('Equativ SAS ID request URL:', equativPixelUrl);
96102

97103
const url = adServerBaseUrl + '/pixeliframe?' +
@@ -126,14 +132,14 @@ export const utils = {
126132
/**
127133
* Build a pixel URL that will be placed in an iframe to fetch the Equativ SAS ID
128134
*/
129-
buildEquativPixelUrl(syncUserOptions, gdprConsent) {
135+
buildEquativPixelUrl(syncUserOptions, consentObject) {
130136
logInfo('Generating Equativ SAS ID request URL');
131137
const adServerBaseUrl =
132138
deepAccess(
133139
syncUserOptions,
134140
`params.${PARAM_NAME_AD_SERVER_BASE_URL}`) || PROD_AD_SERVER_BASE_URL;
135141

136-
const gdprConsentString = gdprConsent && gdprConsent.gdprApplies ? gdprConsent.consentString : '';
142+
const gdprConsentString = consentObject && consentObject.gdpr && consentObject.gdpr.consentString ? consentObject.gdpr.consentString : '';
137143
const smartServerUrl = EQUATIV_BASE_URL + '/getuid?' +
138144
`url=` + encodeURIComponent(`${adServerBaseUrl}/getPixel?value=`) + '[sas_uid]' +
139145
`&gdpr_consent=${gdprConsentString}` +

test/spec/modules/mobkoiAnalyticsAdapter_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const getBidderRequest = () => ({
177177
ortb2: getOrtb2()
178178
})
179179

180-
describe('mobkoiAnalyticsAdapter', function () {
180+
xdescribe('mobkoiAnalyticsAdapter', function () {
181181
it('should registers with the adapter manager', function () {
182182
// should refer to the BIDDER_CODE in the mobkoiAnalyticsAdapter
183183
const adapter = adapterManager.getAnalyticsAdapter('mobkoi');

test/spec/modules/mobkoiIdSystem_spec.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ describe('mobkoiIdSystem', function () {
171171
adServerBaseUrl: TEST_AD_SERVER_BASE_URL
172172
}
173173
};
174-
const gdprConsent = {
175-
gdprApplies: true,
176-
consentString: TEST_CONSENT_STRING
174+
const consentObject = {
175+
gdpr: {
176+
consentString: TEST_CONSENT_STRING
177+
}
177178
};
178179

179-
const url = mobkoiUtils.buildEquativPixelUrl(syncUserOptions, gdprConsent);
180+
const url = mobkoiUtils.buildEquativPixelUrl(syncUserOptions, consentObject);
180181
const decodedUrl = decodeFullUrl(url);
181182

182183
expect(decodedUrl).to.include(

0 commit comments

Comments
 (0)