// Tracking function with a queue property, supports one subscriber Skubacz.tracking = (function () { var q = [], l = null var f = function (event) { if (l) { l(event) } else { q.push(event) } } f.q = q // subscribe and consume the queue f.subscribe = function (listener) { l = listener } // Backwards compatibility in AM (can be removed after theme upgrade) f.startTracking = function(clientId) { f({ tag: 'InitActiveMenu', clientId: clientId}); } return f })()