'use strict';

var angular = require('angular');

module.exports = angular.module('myApp.services.analyticsService', [
])
.service('AnalyticsService', function (
	$location,
	$rootScope,
	$window
) {
	var googelAnalytics = $window.ga;

	function _trackPageView () {
		// use the ga google analytics object
		var pageUrl = $location.url();
		window.console.log(pageUrl);
		googelAnalytics('send', 'pageview', pageUrl);
	}

	function _init () {
		// track page views
		$rootScope.$on('$routeChangeSuccess', _trackPageView);
	}

	return {
		init: _init
	};
});

@@ -198,26 +198,26 @@
  %7B%0A%09var goog
-e
 l
+e
 Analytics = 
@@ -373,10 +373,10 @@
 goog
-e
 l
+e
 Anal
@@ -431,24 +431,68 @@
 n _init () %7B
+%0A%0A%09%09if (!googleAnalytics) %7B%0A%09%09%09return;%0A%09%09%7D%0A%0A
 %0A%09%09// track 

check for function