If you don't find an answer, please click here to post your question.
Reply
Occasional Collector
Posts: 1
Registered: ‎06-12-2018

Angular2 and Adobe Analytics Script

I'm trying to implement Adobe Analytics. I need to place a script tag in the index.html. The script tag is different based on the environment (dev, prod, etc). I don't have access to environments.ts from index.html as far as I know.

I tried using this code but because we do not know how long it will take to load the page, sometimes we are capturing our prod analytics to the dev environment. MindMajix Adobe Analytics can increase the timeout, but this would not be the right approach I think.

setTimeout(function(){ if(window.sessionStorage && window.sessionStorage['ng2-webstorage|production'] === 'true'){ $.getScript( "//assets.adobedtm.com/xxxx, function( data, textStatus, jqxhr ) { _satellite.pageBottom(); }); }else { $.getScript( "//assets.adobedtm.com/cxxx/satelliteLib-xxx-test.js", function( data, textStatus, jqxhr ) { _satellite.pageBottom(); }); } }, 1000);

Ooyalan
Posts: 4
Registered: ‎11-05-2017

Re: Angular2 and Adobe Analytics Script

Hello soujanyabargavi

 

Thank you for your post!

 

Could you please elaborate on what you are trying to achieve?

 

Best,

abhi