@financial-times/ads-display
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -398,2 +398,3 @@ import oAds from '@financial-times/ads-legacy-o-ads'; | ||
* @property {Object} deviceDimensions | ||
* @property {Object} topics | ||
*/ | ||
@@ -460,2 +461,3 @@ | ||
const callback = async payload => { | ||
var _oAds$targeting$get; | ||
const uscookie = getUsPrivacyForTracking(); | ||
@@ -467,2 +469,8 @@ const { | ||
consentsGranular.usprivacy = uscookie; | ||
let topicsOutput; | ||
const topics = oAds === null || oAds === void 0 ? void 0 : (_oAds$targeting$get = oAds.targeting.get()) === null || _oAds$targeting$get === void 0 ? void 0 : _oAds$targeting$get.topic; | ||
if (topics) { | ||
var _oAds$targeting$get2; | ||
topicsOutput = (oAds === null || oAds === void 0 ? void 0 : (_oAds$targeting$get2 = oAds.targeting.get()) === null || _oAds$targeting$get2 === void 0 ? void 0 : _oAds$targeting$get2.topic.split(",")) || []; | ||
} | ||
if (payload) { | ||
@@ -484,2 +492,5 @@ payload.advert = { | ||
} | ||
if (payload && topics) { | ||
payload.topics = topicsOutput; | ||
} | ||
return broadcast("oTracking.event", payload); | ||
@@ -514,3 +525,3 @@ }; | ||
function requestAds() { | ||
emitStateChange({ | ||
emitIasStateChange({ | ||
isReady: true | ||
@@ -535,3 +546,3 @@ }); | ||
} | ||
const registerSlotsWithIas = () => { | ||
function registerSlotsWithIas() { | ||
iasScriptAbortTimeout = setTimeout(requestAds, IASPET_TIMEOUT); | ||
@@ -546,3 +557,3 @@ window.googletag.cmd.push(() => { | ||
}); | ||
}; | ||
} | ||
function getSlotData(slot) { | ||
@@ -556,4 +567,4 @@ const sizes = slot.sizes[slot.screensize] || [[1, 1]]; | ||
} | ||
const runIasTrafficValidation = () => { | ||
emitStateChange({ | ||
function runIasTrafficValidation() { | ||
emitIasStateChange({ | ||
isReady: false | ||
@@ -563,4 +574,4 @@ }); | ||
document.addEventListener("oAds.allSlotsReady", registerSlotsWithIas); | ||
}; | ||
function emitStateChange(detail = {}) { | ||
} | ||
function emitIasStateChange(detail = {}) { | ||
const event = new CustomEvent("ivtStateChange", { | ||
@@ -600,2 +611,4 @@ detail: detail, | ||
runIasTrafficValidation(); | ||
} else { | ||
oAdsInstance.ivtReady = true; | ||
} | ||
@@ -602,0 +615,0 @@ displayAds.initAdSlots(oAdsInstance); |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"typings": "./types.d.ts", | ||
@@ -19,5 +19,5 @@ "files": [ | ||
"dependencies": { | ||
"@financial-times/ads-legacy-o-ads": "^6.3.0", | ||
"@financial-times/ads-permutive": "^6.3.0", | ||
"@financial-times/ads-personalised-consent": "^6.3.0", | ||
"@financial-times/ads-legacy-o-ads": "^6.4.0", | ||
"@financial-times/ads-permutive": "^6.4.0", | ||
"@financial-times/ads-personalised-consent": "^6.4.0", | ||
"@financial-times/n-tracking": "^4.0.1", | ||
@@ -24,0 +24,0 @@ "@financial-times/o-tracking": "^4.0.0", |
44984
916