track user verification and add statistics of verified users who did not vote proposals
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
//= require registration_form
|
||||
//= require suggest
|
||||
//= require forms
|
||||
//= require tracks
|
||||
|
||||
var initialize_modules = function() {
|
||||
App.Comments.initialize();
|
||||
@@ -57,6 +58,7 @@ var initialize_modules = function() {
|
||||
App.RegistrationForm.initialize();
|
||||
App.Suggest.initialize();
|
||||
App.Forms.initialize();
|
||||
App.Tracks.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
|
||||
28
app/assets/javascripts/tracks.js.coffee
Normal file
28
app/assets/javascripts/tracks.js.coffee
Normal file
@@ -0,0 +1,28 @@
|
||||
App.Tracks =
|
||||
|
||||
tracking_enabled: ->
|
||||
_paq?
|
||||
|
||||
set_custom_var: (id, name, value, scope) ->
|
||||
_paq.push(['setCustomVariable', id, name, value, scope])
|
||||
_paq.push(['trackPageView'])
|
||||
|
||||
track_event: ($this) ->
|
||||
category = $this.data('track-event-category')
|
||||
action = $this.data('track-event-action')
|
||||
_paq.push(['trackEvent', category, action])
|
||||
|
||||
initialize: ->
|
||||
if App.Tracks.tracking_enabled()
|
||||
$('[data-track-usertype]').each ->
|
||||
$this = $(this)
|
||||
usertype = $this.data('track-usertype')
|
||||
App.Tracks.set_custom_var(1, "usertype", usertype, "visit")
|
||||
|
||||
$('[data-track-event-category]').each ->
|
||||
$this = $(this)
|
||||
App.Tracks.track_event($this)
|
||||
|
||||
$('[data-track-click]').on 'click', ->
|
||||
$this = $(this)
|
||||
App.Tracks.track_event($this)
|
||||
Reference in New Issue
Block a user