Просмотр исходного кода

Track hints feedback in both GA and Countly; clean-up.

Paulo Reis 10 лет назад
Родитель
Сommit
8e2475afdc

+ 5 - 3
services/web/app/views/layout.jade

@@ -71,21 +71,23 @@ html(itemscope, itemtype='http://schema.org/Product')
 			if (session && session.user)
 				script(type="text/javascript").
 					Countly.q.push(['user_details', {
-						handle: '#{session.user._id}',
 						email: '#{session.user.email}',
+						custom: {
+							handle: '#{session.user._id}',
+						}
 					}]);
 
 			if (justRegistered)
 				script(type="text/javascript").
 					Countly.q.push(['add_event',{
 						key: 'user-registered'
-					});
+					}]);
 
 			if (justLoggedIn)
 				script(type="text/javascript").
 					Countly.q.push(['add_event',{
 						key: 'user-logged-in'
-					});
+					}]);
 		// End countly Analytics
 				
 		script(type="text/javascript").

+ 1 - 0
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -20,6 +20,7 @@ define [
 			event_tracking.sendCountly "logs-hints-learn-more"
 
 		trackLogHintsFeedback = (isPositive, hintId) ->
+			event_tracking.send 'log-hints', (if isPositive then 'feedback-positive' else 'feedback-negative'), hintId
 			event_tracking.sendCountly "log-hints-feedback", { isPositive, hintId }
 
 		$scope.trackLogHintsPositiveFeedback = (hintId) -> trackLogHintsFeedback true, hintId

+ 2 - 3
services/web/public/coffee/main/event.coffee

@@ -9,9 +9,8 @@ define [
 
 			sendCountly: (key, segmentation) ->
 				eventData = { key }
-				eventData.segmentation = segmentation if segmentation?
-
-				Countly.q.push([ "add_event", eventData ]);
+				eventData.segmentation = segmentation if segmentation?				
+				Countly?.q.push([ "add_event", eventData ]);
 		}
 
 	# App.directive "countlyTrack", () ->