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

Sirdata Real-time Data Module: add new RTD module #6515

Merged
merged 25 commits into from
Apr 10, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update sirdataRtdProvider.js
with Proxistore
  • Loading branch information
nouchy committed Mar 30, 2021
commit a14b190e847fb276ba1570e2b3f3d7ad60c62d74
21 changes: 15 additions & 6 deletions modules/sirdataRtdProvider.js
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ export function addSegmentData(adUnits, data, config, onDone, gobalConfig) {
});
_set(bid, 'params.target', target.join(';'));
} catch (err) {
utils.logError(err.message)
utils.logError(err.message);
}
}
} else if (bid.bidder == 'ix') {
@@ -290,13 +290,21 @@ export function addSegmentData(adUnits, data, config, onDone, gobalConfig) {
if (bidderIndex && bidderIndex >= 0 && typeof config.params.bidders[bidderIndex].customFunction == 'function') {
loadCustomFunction(config.params.bidders[bidderIndex].customFunction, adUnit, sirdataData.segments.concat(sirdataData.categories).concat(curationData.segments).concat(curationData.categories), data, bid);
} else {
var cappIxCategories = [];
var ixLength = 0;
var ixLimit = config.params.bidders[bidderIndex].sizeLimit || 1000;
// Push ids For publisher use and for curation if exists
var newFpd = Object.assign(ixConfig, {'sd_rtd': sirdataData.segments.concat(sirdataData.categories).concat(curationData.segments).concat(curationData.categories)});
gobalConfig.setConfig({
ix: {
firstPartyData: newFpd
sirdataData.segments.concat(sirdataData.categories).concat(curationData.segments).concat(curationData.categories).forEach(function(entry) {
if (ixLength < ixLimit) {
cappIxCategories.push(entry);
ixLength += entry.toString().length;
utils.logInfo(ixLength);
}
});
if (cappIxCategories.length > 0) {
var newFpd = Object.assign(ixConfig, {'sd_rtd': cappIxCategories});
gobalConfig.setConfig({ix: {firstPartyData: newFpd}});
}
}
} catch (err) {
utils.logError(err.message)
@@ -321,7 +329,8 @@ export function addSegmentData(adUnits, data, config, onDone, gobalConfig) {
if (bidderIndex && bidderIndex >= 0 && typeof config.params.bidders[bidderIndex].customFunction == 'function') {
loadCustomFunction(config.params.bidders[bidderIndex].customFunction, adUnit, sirdataData.segments.concat(sirdataData.categories).concat(curationData.segments).concat(curationData.categories), data, bid);
} else {
_set(bid, 'ortb2.user.ext.data', {segments: data.segments, contextual_categories: data.contextual_categories});
// _set(bid, 'ortb2.user.ext.data', {segments: data.segments, contextual_categories: data.contextual_categories});
_set(bid, 'ortb2Imp.ext.data', {segments: data.segments, contextual_categories: data.contextual_categories});
}
}
}