From e5040e25c70b0cd7ac37e08d54620c291ebe299e Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Fri, 15 Sep 2023 16:08:35 +0530 Subject: [PATCH] feat(appcues): added proxyUrl support --- src/integrations/Appcues/browser.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/integrations/Appcues/browser.js b/src/integrations/Appcues/browser.js index c1c8b1e63..6aad15527 100644 --- a/src/integrations/Appcues/browser.js +++ b/src/integrations/Appcues/browser.js @@ -24,9 +24,12 @@ class Appcues { init() { logger.debug('===in init Appcues==='); - const url = isDefinedAndNotNullAndNotEmpty(this.proxyUrl) - ? this.proxyUrl - : `https://fast.appcues.com/${this.accountId}.js`; + let url = `https://fast.appcues.com/${this.accountId}.js`; + if (isDefinedAndNotNullAndNotEmpty(this.proxyUrl) && typeof this.proxyUrl === 'string') { + url = this.proxyUrl.includes(`${this.accountId}.js`) + ? this.proxyUrl + : `${this.proxyUrl}/${this.accountId}.js`; + } ScriptLoader('appcues-id', url); }