Sha256: 76c673f50b07a7190fe7e0350de7e56f49153741d95a20a8e9f1e64fa34744a8

Contents?: true

Size: 770 Bytes

Versions: 15

Compression:

Stored size: 770 Bytes

Contents

require('jquery')
require('jquery-ujs')
require('jquery.cookie')
var _  = require('lodash')
var is = require('is')

require('./init/controllers')
require('./init/forms')

window.track = function(event, attributes, fn){
  console.log("Track: " + event + " " + JSON.stringify(attributes))

  if (is.fn(attributes)) fn = attributes, attributes = null;
  if (is.undefined(attributes)) { attributes = {} }
  if ($.cookie('invisible') == "true") {
    if (!is.undefined(fn)) { fn() }
    return
  }

  var attrs = _.extend({
    iteration: $('body').data('iteration')
  }, attributes)

  if (typeof(analytics) != 'undefined') {
    analytics.track(event, attrs, fn);
  }

  if (typeof(amplitude) != 'undefined') {
    amplitude.getInstance().logEvent(event, attrs, fn);
  }
}

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
mvpkit-2.0.0 assets/js/application.js
mvpkit-1.1.2 assets/js/application.js
mvpkit-1.1.1 assets/js/application.js
mvpkit-1.1.0 assets/js/application.js
mvpkit-1.0.4 assets/js/application.js
mvpkit-1.0.3 assets/js/application.js
mvpkit-1.0.2 assets/js/application.js
mvpkit-1.0.1 assets/js/application.js
mvpkit-1.0.0 assets/js/application.js
mvpkit-0.8.1 assets/js/application.js
mvpkit-0.8.0 assets/js/application.js
minimum_viable_product-0.7.15 assets/js/application.js
minimum_viable_product-0.7.14 assets/js/application.js
minimum_viable_product-0.7.13 assets/js/application.js
minimum_viable_product-0.7.12 assets/js/application.js