As @BenStephenson said, the general use case is TiQ receiving tracking events from the page (and/or automatically triggering pageview events on load). Those incoming "events" are then compared to Load Rules for Tags, which are fired if appropriate. The functionality implied by your snippet would be covered in the corresponding Tag Template and/or tag-scoped Extensions (to manipulate the data more manually, if needed). Tags 'subscribe' to events based on their Load Rules inside TiQ. I've never tried, but I don't see why I wouldn't be possible to set something custom up in TiQ to trigger window-level events for other code to listen for, if there were a compelling use case to keep tag-like code outside of TiQ. But that's not available out-of-the-box, and I'd expect using a Tag to be the better option in nearly every case (for all the reasons it's useful to have all Tags in a single TMS, etc.).
Hope that helps?
... View more