Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
Created April 15, 2013 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaboesquivel/5391615 to your computer and use it in GitHub Desktop.
Save gaboesquivel/5391615 to your computer and use it in GitHub Desktop.
window.track = (event_name, event_description) ->
analytics.track(event_name) unless typeof analytics == 'undefined'
mixpanel.track(event_name) unless typeof mixpanel == 'undefined'
ga_track_event(event_name, event_description)
window.logActionKPI = (name) ->
$.get "/api/kpis/log_action", { kpi: { name: name } }
$ ->
$("[tracked-click]").live "click", ->
event_name = $(this).attr("tracked-click")
console.log event_name
track(event_name, "click")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment