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

This commit is contained in:
Paulo Reis 2016-07-06 14:24:50 +01:00
parent 0dd3a70b4b
commit 8e2475afdc
3 changed files with 8 additions and 6 deletions

View file

@ -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").

View file

@ -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

View file

@ -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", () ->