I have an app that requires both some passive and active event tracking. In general, I have a main Controller, but haven’t yet put much logic into a View yet. When users interact with the interface, I want track these types of events:
- page views (active)
- votes (active)
- time spent on the page (passive) etc…
I want these events to be passed on to a tracking API using traditional POST requests. I’m confused as to where to put this logic. I have the inclination to keep tracking logic separate from my main user experience since it seems like an isolated function, but then I don’t want to give a reusable component (like analytics tracking) too much control. Also, I’m not sure if this should be another controller, and if so, how best to implement. Further, should all communications with the server generally be grouped together so that the Tracker utilizes a “Utils” or something?
Any advice on how to best separate function and utility in an ember app? Thanks so much!