Skip to content

Commit

Permalink
Don't set keys to empty string if the slot never targeted them in the…
Browse files Browse the repository at this point in the history
… first place.
  • Loading branch information
mkendall07 committed Jan 6, 2016
1 parent 84f4990 commit de1ea0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,18 @@ function getWinningBid(bidArray) {
function setGPTAsyncTargeting(code, slot) {
//get the targeting that is already configured
var keyStrings = getTargetingfromGPTIdentifier(slot);
//copy keyStrings into pb_keyHistoryMap
utils.extend(pb_keyHistoryMap, keyStrings);
utils._each(pb_keyHistoryMap, function(value, key){
//copy keyStrings into pb_keyHistoryMap by code
if(!pb_keyHistoryMap[code]){
pb_keyHistoryMap[code] = keyStrings;
}
else{
utils.extend(pb_keyHistoryMap[code], keyStrings);
}
utils._each(pb_keyHistoryMap[code], function(value, key){
//since DFP doesn't support deleting a single key, we will set all to empty string
//This is "clear" for that key
slot.setTargeting(key, '');
utils.logMessage('Setting the key : ' + key + ' to empty string for code: ' + code);
});
for (var key in keyStrings) {
if (keyStrings.hasOwnProperty(key)) {
Expand Down

0 comments on commit de1ea0a

Please sign in to comment.