Orientationchange in Adobe DTM for Adobe Analytics tool

So I’m trying to get the orientationchange event in Adobe DTM to work and then fire an Adobe Analytics event. The built in orientationchange event in DTM is not working for me so I’m trying to implement my own solution. The code I’ve produced is: Adobe Experience manager

(function () {
var width = screen.width,
height = screen.height;
setInterval(function () {
if (screen.width == height || screen.height == width) {
width = screen.width;
height = screen.height;
alert(“Orientation Changed”);
}
}, 50);
}());
This is working as long as I place it in the JavaScript section. As soon as I place it in the Adobe Analytics Custom Code section it ceases to work. Is there a way that I can get an Adobe Analytics event to fire from the JavaScript section (adding s.events=“event11” didn’t work for me) or get this code to work in the Adobe Analytics custom code section?

Ummm??.. are you in the correct forum?:face_with_raised_eyebrow: