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

Adnuntius Bid Adapter: site Ext Data sent as key values #11465

Merged
merged 1 commit into from
May 13, 2024
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
17 changes: 14 additions & 3 deletions modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ const storageTool = (function () {
return segments
}

const getKvsFromOrtb = function (ortb2) {
const siteData = deepAccess(ortb2, 'site.ext.data');
if (siteData) {
return siteData
} else {
return null
}
}

return {
refreshStorage: function (bidderRequest) {
const ortb2 = bidderRequest.ortb2 || {};
Expand All @@ -163,18 +172,19 @@ const storageTool = (function () {
});
}
metaInternal.segments = getSegmentsFromOrtb(ortb2);
metaInternal.kv = getKvsFromOrtb(ortb2);
},
saveToStorage: function (serverData, network) {
setMetaInternal(serverData, network);
},
getUrlRelatedData: function () {
// getting the URL information is theoretically not network-specific
const { segments, usi, voidAuIdsArray } = metaInternal;
return { segments, usi, voidAuIdsArray };
const { segments, kv, usi, voidAuIdsArray } = metaInternal;
return { segments, kv, usi, voidAuIdsArray };
},
getPayloadRelatedData: function (network) {
// getting the payload data should be network-specific
const { segments, usi, userId, voidAuIdsArray, voidAuIds, ...payloadRelatedData } = getMetaDataFromLocalStorage(network).reduce((a, entry) => ({...a, [entry.key]: entry.value}), {});
const { segments, kv, usi, userId, voidAuIdsArray, voidAuIds, ...payloadRelatedData } = getMetaDataFromLocalStorage(network).reduce((a, entry) => ({ ...a, [entry.key]: entry.value }), {});
return payloadRelatedData;
}
};
Expand Down Expand Up @@ -252,6 +262,7 @@ export const spec = {
}

const targeting = bid.params.targeting || {};
if (urlRelatedMetaData.kv) targeting.kv = urlRelatedMetaData.kv;
const adUnit = { ...targeting, auId: bid.params.auId, targetId: bid.params.targetId || bid.bidId };
const maxDeals = Math.max(0, Math.min(bid.params.maxDeals || 0, MAXIMUM_DEALS_LIMIT));
if (maxDeals > 0) {
Expand Down
Loading