Added a service class and offloading Google Analytics task to it