Skip to content

Commit

Permalink
Reset hb_* keys only for registered aduniits (prebid#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlane authored and Nate Cozi committed Jan 19, 2017
1 parent 509272b commit caf92b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ targeting.resetPresetTargeting = function() {
if (isGptPubadsDefined()) {
window.googletag.pubads().getSlots().forEach(slot => {
pbTargetingKeys.forEach(function(key){
slot.setTargeting(key,null);
// reset only registered adunits
$$PREBID_GLOBAL$$.adUnits.find(function(unit) {
if (unit.code === slot.getAdUnitPath() ||
unit.code === slot.getSlotElementId()) {
slot.setTargeting(key, null);
}
});
});
});
}
Expand Down

0 comments on commit caf92b2

Please sign in to comment.