var trackingFunc = function() { window.edit_page.Event.subscribe('topicName', function(topic, data) { }); } if (typeof _strk != 'undefined') { _strk.push(['Page.didMount', trackingFunc]); } else { window.runAfterDomBinding.add('custom', trackingFunc); }