Added Analytics monitoring code