@financial-times/o-ads
Advanced tools
Comparing version 15.0.0 to 16.0.0
@@ -546,12 +546,15 @@ "use strict"; | ||
function clearPageTargeting() { | ||
if (window.googletag) { | ||
googletag.cmd.push(() => { | ||
googletag.pubads().clearTargeting(); | ||
}); | ||
} else { | ||
_utils.default.log.warn('Attempting to clear page targeting before the GPT library has initialized'); | ||
} | ||
} | ||
function updatePageTargeting(override) { | ||
if (window.googletag) { | ||
var params = _utils.default.isPlainObject(override) ? override : _targeting.default.get(); | ||
if (!override) { | ||
googletag.cmd.push(() => { | ||
googletag.pubads().clearTargeting(); | ||
}); | ||
} | ||
setPageTargeting(params); | ||
@@ -590,2 +593,3 @@ } else { | ||
updatePageTargeting, | ||
clearPageTargeting, | ||
clearPageTargetingForKey, | ||
@@ -592,0 +596,0 @@ hasGPTLoaded, |
@@ -28,3 +28,3 @@ { | ||
"name": "@financial-times/o-ads", | ||
"version": "15.0.0", | ||
"version": "16.0.0", | ||
"dependencies": { | ||
@@ -31,0 +31,0 @@ "ftdomdelegate": "^4.0.0", |
@@ -520,10 +520,16 @@ /*globals googletag: true */ | ||
function clearPageTargeting() { | ||
if (window.googletag) { | ||
googletag.cmd.push(() => { | ||
googletag.pubads().clearTargeting(); | ||
}); | ||
} | ||
else { | ||
utils.log.warn('Attempting to clear page targeting before the GPT library has initialized'); | ||
} | ||
} | ||
function updatePageTargeting(override) { | ||
if (window.googletag) { | ||
const params = utils.isPlainObject(override) ? override : targeting.get(); | ||
if (!override) { | ||
googletag.cmd.push(() => { | ||
googletag.pubads().clearTargeting(); | ||
}); | ||
} | ||
setPageTargeting(params); | ||
@@ -560,2 +566,3 @@ } else { | ||
updatePageTargeting, | ||
clearPageTargeting, | ||
clearPageTargetingForKey, | ||
@@ -562,0 +569,0 @@ hasGPTLoaded, |
210276
5972