Including Adobe DTM asynchronous in AngularJS
We have a platform developed with AngularJS. The platform is the same for all our customers. We must include Adobe DTM only for a client.
I sometimes have external scripts that aren't loaded. Do you have a better way to do it?
here my code :
var adobedtm = '//assets.adobedtm.com/5249...abe2e5/satelliteLib-2d8560...eb5937-staging.js';
if( window._env.environment === 'production' ){
adobedtm = "//assets.adobedtm.com/5249...abe2e5/satelliteLib-2d8560...eb5937.js"
}
$.getScript('//cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.8/postscribe.min.js', function (data, textStatus, jqxhr){
postscribe(document.body, '<script src="' + adobedtm + '" type="text/javascript"><script type="text/javascript">_satellite.setDebug(true);</script><script type="text/javascript">_satellite.pageBottom();</script>');
});