Skip to content

Commit

Permalink
return id once element is found
Browse files Browse the repository at this point in the history
  • Loading branch information
Gleb Glushtsov committed Jun 18, 2019
1 parent acb0162 commit c2cb54d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,16 @@ function _mapAdUnitPathToElementId(adUnitCode) {
if (utils.isGptPubadsDefined()) {
const adSlots = googletag.pubads().getSlots();
const isMatchingAdSlot = utils.isSlotMatchingAdUnitCode(adUnitCode);
let matchingAdSlot = null;
let id;

for (let i = 0; i < adSlots.length; i++) {
if (isMatchingAdSlot(adSlots[i])) {
matchingAdSlot = adSlots[i]
break;
}
}
id = adSlots[i].getSlotElementId();

if (matchingAdSlot !== null) {
const id = matchingAdSlot.getSlotElementId();
utils.logInfo(`[33Across Adapter] Map ad unit path to HTML element id: '${adUnitCode}' -> ${id}`);

utils.logInfo(`[33Across Adapter] Map ad unit path to HTML element id: '${adUnitCode}' -> ${id}`);

return id;
return id;
}
}
}

Expand Down

0 comments on commit c2cb54d

Please sign in to comment.