Middleware to handle tracking for use with revtrax