diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 6457838dd45..5a308498981 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -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; + } } }