Skip to content

Commit

Permalink
Fix geo first party data (#8013)
Browse files Browse the repository at this point in the history
that should not be attached
to `device` but to `user` litteral

Co-authored-by: François Maturel <francoismaturel@dijit.fr>
  • Loading branch information
MK Platform and François Maturel authored Feb 9, 2022
1 parent 5cb9ab4 commit fd32042
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 0 additions & 5 deletions modules/mediakeysBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,6 @@ export const spec = {
if (fpd.user) {
mergeDeep(payload, { user: fpd.user });
}
// Here we can handle device.geo prop
const deviceGeo = deepAccess(fpd, 'device.geo');
if (deviceGeo) {
mergeDeep(payload.device, { geo: deviceGeo });
}

const request = {
method: 'POST',
Expand Down
14 changes: 9 additions & 5 deletions test/spec/modules/mediakeysBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,15 @@ describe('mediakeysBidAdapter', function () {
},
user: {
yob: 1985,
gender: 'm'
},
device: {
gender: 'm',
geo: {
country: 'FR',
city: 'Marseille'
},
ext: {
data: {
registered: true
}
}
}
}
Expand All @@ -596,8 +599,9 @@ describe('mediakeysBidAdapter', function () {
expect(data.site.ext.data.category).to.equal('sport');
expect(data.user.yob).to.equal(1985);
expect(data.user.gender).to.equal('m');
expect(data.device.geo.country).to.equal('FR');
expect(data.device.geo.city).to.equal('Marseille');
expect(data.user.geo.country).to.equal('FR');
expect(data.user.geo.city).to.equal('Marseille');
expect(data.user.ext.data.registered).to.be.true;
});
});

Expand Down

0 comments on commit fd32042

Please sign in to comment.