_satellite.loadScript
This function was used internally in DTM to load script from a hosted location at runtime. It was considered an internal function, but proved too tempting to those who knew its power.
It does not exist externally in Launch.
Remedy:
The SDI Toolkit extension provides a way to expose Launch's internal loadScript module at runtime. To take advantage of this, Install the SDI Toolkit extension and on the Util Functions tab, check the box that says "Expose loadScript function from Launch Reactor."
Enabling loadScript in SDI Toolkit
Once done, the loadScript function can be accessed at window._sdiToolkit.reactor.loadScript
1
//Crusty old DTM way
2
_satellite.loadScript('https://www.googletagmanager.com/gtag/js?id=ABC123');
3
4
//Shiny new Launch way
5
_sdiToolkit.reactor.loadScript('https://www.googletagmanager.com/gtag/js?id=ABC123');
6
Copied!
Note that _sdiToolkit.reactor.loadScriptreturns a Promise which allows you options to sequence other operations to happen after the script loads if necessary.
Last modified 2yr ago
Copy link