ERROR ReferenceError: s is not defined
- June 27, 2023
- 2 replies
- 3582 views
Hello,
I'm using Commanders Act as TMS for Adobe Analytics and since I moved the CMP to Didomi I got some problems with the s object which sometimes si "undefined" specially for tags on spa pages.
I tried to initialise it with a condition when s === "undefined" with var s = new AppMeasurement(); however it doesn't work, if I do so, I have other errors like s.apl is not a function.
My Adobe config tag looks like this:
- trigger container loaded:
var scriptElt2 = document.createElement("script");
scriptElt2.id = "tc_script__2";
scriptElt2.language = "javascript";
scriptElt2.src="Appmeasurement.js";
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] || document.getElementsByTagName('script')[0].parentNode).insertBefore(scriptElt2, null);
My appmeasurement file is also enclosed to the tag.
In the same tag on Didomi event(which comes after container is loaded I have conditions for sending evars etc.
And also functions for plugins
So when I have a tag with s object "undefined" does it mean that the app measurement file is not available?
I put and executed the function in the console and it doesn't change anything.
Anyone could help?
Thanks