diff --git a/analytics.js b/analytics.js index ef16b2b41f..10d03bbecd 100644 --- a/analytics.js +++ b/analytics.js @@ -31,7 +31,8 @@ import { import { CONFIG_URL, MAX_WAIT_FOR_INTEGRATION_LOAD, - INTEGRATION_LOAD_CHECK_INTERVAL + INTEGRATION_LOAD_CHECK_INTERVAL, + CDN_BASE_URL, } from "./utils/constants"; import RudderElementBuilder from "./utils/RudderElementBuilder"; import Storage from "./utils/storage"; @@ -206,11 +207,14 @@ class Analytics { } /* - * Dyanamically load the required client integration from CDN - */ + * Dyanamically load the required client integration from CDN + */ loadIntegrationModule(modName) { - const cdnURL = `https://cdn.rudderstack.com/v2/js-integrations/${modName}.js`; - /*import(cdnURL) + // const cdnURL = `${CDN_BASE_URL}/${modName}.js`; + // For testing purposes only + const cdnURL = + "https://ddim5kcy73icz.cloudfront.net/integration/AdobeAnalytics.js"; + fetch(cdnURL) .then((modObj) => { this.dynamicallyLoadedIntegrations[modName] = modObj; }) @@ -220,7 +224,7 @@ class Analytics { modName, err ); - });*/ + }); } /** diff --git a/utils/constants.js b/utils/constants.js index 5454214de5..590f8ac350 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -81,6 +81,7 @@ const RudderIntegrationPlatform = { const BASE_URL = "https://hosted.rudderlabs.com"; // default to RudderStack const CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=process.module_type&v=process.package_version"; +const CDN_BASE_URL = "https://cdn.rudderstack.com/v2/js-integrations"; const FLUSH_QUEUE_SIZE = 30;