factor out tracking events into their own API