2014-07-21 06:33:10 -04:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
|
|
|
|
App.factory "event_tracking", ->
|
|
|
|
return {
|
|
|
|
send: (category, action, label, value)->
|
|
|
|
ga('send', 'event', category, action, label, value)
|
2016-07-06 07:26:21 -04:00
|
|
|
|
|
|
|
sendCountly: (key, segmentation) ->
|
|
|
|
eventData = { key }
|
|
|
|
eventData.segmentation = segmentation if segmentation?
|
|
|
|
|
2016-07-06 07:32:33 -04:00
|
|
|
Countly.q.push([ "add_event", eventData ]);
|
2014-07-21 06:33:10 -04:00
|
|
|
}
|
|
|
|
|
2016-07-06 07:26:21 -04:00
|
|
|
# App.directive "countlyTrack", () ->
|
|
|
|
# return {
|
|
|
|
# restrict: "A"
|
|
|
|
# scope: false,
|
|
|
|
# link: (scope, el, attrs) ->
|
|
|
|
# eventKey = attrs.countlyTrack
|
|
|
|
# if (eventKey?)
|
|
|
|
# el.on "click", () ->
|
|
|
|
# console.log eventKey
|
|
|
|
# }
|
2014-07-21 06:33:10 -04:00
|
|
|
|
|
|
|
#header
|
|
|
|
$('.navbar a').on "click", (e)->
|
|
|
|
href = $(e.target).attr("href")
|
|
|
|
if href?
|
|
|
|
ga('send', 'event', 'navigation', 'top menu bar', href)
|