From dde620f6b7dad7e2a60af23f9c0e2211848f907d Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Fri, 18 Jan 2019 10:57:00 -0500 Subject: [PATCH] refactor: Check for updateCorrelator Check for deprecated updateCorrelator method before calling --- src/createManager.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/createManager.js b/src/createManager.js index 4f313d5..489c8bb 100644 --- a/src/createManager.js +++ b/src/createManager.js @@ -459,8 +459,14 @@ export class AdManager extends EventEmitter { if (!this.pubadsReady) { return false; } - this.googletag.pubads().updateCorrelator(); - + // Note, `updateCorrelator` has been deprecated. This is a short-term patch + // to ensure the method will not be called when it is removed from GPT. + // A better fix to come... + if ("updateCorrelator" in this.googletag.pubads()) { + this.googletag.pubads().updateCorrelator(); + } else { + console.warn("Ad: `updateCorrelator` has been removed from GPT"); + } return true; }