mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-29 14:03:07 +00:00
18 lines
422 B
CoffeeScript
18 lines
422 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
|
|
App.factory "event_tracking", ->
|
|
return {
|
|
send: (category, action, label, value)->
|
|
ga('send', 'event', category, action, label, value)
|
|
event_name = "#{action}-#{category}"
|
|
window?.heap?.track?(event_name, {label, value})
|
|
}
|
|
|
|
|
|
#header
|
|
$('.navbar a').on "click", (e)->
|
|
href = $(e.target).attr("href")
|
|
if href?
|
|
ga('send', 'event', 'navigation', 'top menu bar', href)
|