@financial-times/ads-display
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -536,11 +536,15 @@ import oAds from '@financial-times/ads-legacy-o-ads'; | ||
window.googletag.cmd.push(() => { | ||
const gptSlots = window.googletag.pubads().getSlots(); | ||
const gptSlots = getSlotData(); | ||
const iasPETSlots = gptSlots.map(slot => { | ||
const sizes = slot.getSizes().map(size => { | ||
if (size.getWidth && size.getHeight) return [size.getWidth(), size.getHeight()];else return [1, 1]; | ||
const sizes = slot.sizes.map(size => { | ||
if (Array.isArray(size)) { | ||
return [size[0], size[1]]; | ||
} else { | ||
return [1, 1]; | ||
} | ||
}); | ||
return { | ||
adSlotId: slot.getSlotElementId(), | ||
adSlotId: slot.id, | ||
size: sizes, | ||
adUnitPath: slot.getAdUnitPath() | ||
adUnitPath: slot.adUnitPath | ||
}; | ||
@@ -554,2 +558,10 @@ }); | ||
}; | ||
const getSlotData = () => { | ||
const currentBreakpoint = window.oAds.utils.responsive.getCurrent(); | ||
return Object.values(window.oAds.slots).filter(slot => slot.gpt && slot.sizes && slot.sizes[currentBreakpoint]).map(slot => ({ | ||
id: slot.gpt.id, | ||
sizes: slot.sizes[currentBreakpoint], | ||
adUnitPath: slot.gpt.unitName | ||
})); | ||
}; | ||
const validateTrafficIasScript = () => { | ||
@@ -556,0 +568,0 @@ attachIasScript(); |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"typings": "./types.d.ts", | ||
@@ -19,6 +19,6 @@ "files": [ | ||
"dependencies": { | ||
"@financial-times/ads-legacy-o-ads": "^6.1.0", | ||
"@financial-times/ads-moat-integration": "^6.1.0", | ||
"@financial-times/ads-permutive": "^6.1.0", | ||
"@financial-times/ads-personalised-consent": "^6.1.0", | ||
"@financial-times/ads-legacy-o-ads": "^6.1.1", | ||
"@financial-times/ads-moat-integration": "^6.1.1", | ||
"@financial-times/ads-permutive": "^6.1.1", | ||
"@financial-times/ads-personalised-consent": "^6.1.1", | ||
"@financial-times/n-tracking": "^4.0.1", | ||
@@ -25,0 +25,0 @@ "@financial-times/o-tracking": "^4.0.0", |
46137
916