track user verification and add statistics of verified users who did not vote proposals

This commit is contained in:
palomahnhp
2016-03-13 18:29:55 +01:00
parent 0b1b4384ee
commit 7d4936b577
18 changed files with 210 additions and 2 deletions

View File

@@ -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(){

View 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)