event_tracking.coffee 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. require [
  2. ], ()->
  3. #plans page
  4. $('a.sign_up_now').on 'click', (e)->
  5. ga_PlanType = $(@).attr("ga_PlanType")
  6. ga 'send', 'event', 'subscription-funnel', 'sign_up_now_button', ga_PlanType
  7. $('#annual-pricing').on 'click', ->
  8. ga 'send', 'event', 'subscription-funnel', 'plans-page', 'annual-prices'
  9. $('#student-pricing').on 'click', ->
  10. ga('send', 'event', 'subscription-funnel', 'plans-page', 'student-prices')
  11. $('#plansLink').on 'click', ->
  12. ga 'send', 'event', 'subscription-funnel', 'go-to-plans-page', 'from menu bar'
  13. #list page
  14. $('#newProject a').on 'click', (e)->
  15. ga 'send', 'event', 'project-list-page-interaction', 'new-project', $(@).text().trim()
  16. $('#projectFilter').on 'keydown', (e)->
  17. ga 'send', 'event', 'project-list-page-interaction', 'project-search', 'keydown'
  18. $('#projectList .project-actions li a').on 'click', (e)->
  19. ga 'send', 'event', 'project-list-page-interaction', 'project action', $(@).text().trim()
  20. #left menu navigation
  21. $('.tab-link.account-settings-tab').on 'click', ->
  22. ga 'send', 'event', 'navigation', 'left menu bar', 'user settings link'
  23. $('.tab-link.subscription-tab').on 'click', ->
  24. ga 'send', 'event', 'navigation', 'left menu bar', 'subscription managment link'
  25. #menu bar navigation
  26. $('.userSettingsLink').on 'click', ->
  27. ga 'send', 'event', 'navigation', 'top menu bar', 'user settings link'
  28. $('.subscriptionLink').on 'click', ->
  29. ga 'send', 'event', 'navigation', 'top menu bar', 'subscription managment link'
  30. $('.logoutLink').on 'click', ->
  31. ga 'send', 'event', 'navigation', 'top menu bar', 'logout'
  32. $('#templatesLink').on 'click', ->
  33. ga 'send', 'event', 'navigation', 'top menu bar', 'templates'
  34. $('#blogLink').on 'click', ->
  35. ga 'send', 'event', 'navigation', 'top menu bar', 'blog'
  36. $('#learnLink').on 'click', ->
  37. ga 'send', 'event', 'navigation', 'top menu bar', 'learn link'
  38. $('#resourcesLink').on 'click', ->
  39. ga 'send', 'event', 'navigation', 'top menu bar', 'resources link'
  40. $('#aboutUsLink').on 'click', ->
  41. ga 'send', 'event', 'navigation', 'top menu bar', 'about us link'
  42. # editor
  43. $('#hotkeysLink').on 'click', ->
  44. ga 'send', 'event', 'navigation', 'editor', 'show hot keys link'
  45. $('#editorTourLink').on 'click', ->
  46. ga 'send', 'event', 'navigation', 'editor', 'editor tour link'