Abode Analytics Javascript Library AppMeasurement.js 2.12 is being used for Adobe Plugin development. We came across an error with 2.12 version of AppMeasurement.js – “Uncaught TypeError: Cannot read property 'ac' of undefined". On analysis we could find that, with 2.12.0’s AppMeasurement.js, AppMeasurement instance doesn’t exist for window object. This issue could only be resolved by modified the code mentioned as - “DO NOT ALTER ANYTHING BELOW THIS LINE”.
We are importing AppMeasurement.js into the JavaScript file. The error mentioned occurs only if we are importing the AppMeasurement.js to our JavaScript file and is not there if we are adding it through a script tag in the html file where the JavaScript file is used (as suggested in Adobe Analytics sample code).
This error is not seen with 1.5.1 version of Adobe Analyics AppMeasurement.js.
Error details:
AppMeasurement instance is null
function AppMeasurement(r){var a=this;a.version="2.12.0";var k=window;k.s_c_in||(k.s_c_il=[],k.s_c_in=0);a._il=k.s_c_il;a._in=k.s_c_in;a._il[a._in]=a;k.s_c_in++;a._c="s_c";varq=k.AppMeasurement.ac;q||(q=null);var p=k,m,s;try{for(m=p.parent,s=p.location;m&&m.location&&s&&""+m.location!=""+s&&p.location&&""+m.location!=""+p.location&&m.location.host==s.host;)p=m,m=p.pare
Workaround:
function AppMeasurement(r){var a=this;a.version="2.12.0";window.AppMeasurement=AppMeasurement;var
However for our purpose, we would need to import AppMeasurment.js to our JavaScript file without adding script tags in html. So could you please help us with some other alternate solution for this issue as we dont want to edit the line which is clearly mentioned as “DO NOT ALTER ANYTHING BELOW THIS LINE