Without seeing your code, it's hard to give exact details, but you should be able to capture a launch from the selection of the "Play" button on your springboard (or from the poster screen, if you're not using a springboard), at which point you could send an asynchronous web request (or synchronous, if you're not concerned about the delay it might cause) to your server to capture the data. Then, on your video screen, be sure to call SetNotificationPeriod(), and you can use the notification event to send additional web requests to your server to record playback time.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)