Sha256: 8f70160534ef428ded50b4555b2ac91fee225df4d804b80238a76b08be8e4615

Contents?: true

Size: 599 Bytes

Versions: 3

Compression:

Stored size: 599 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
mvpkit-1.1.2 project/app/webpack/javascripts/lib/analytics.js
mvpkit-1.1.1 project/app/webpack/javascripts/lib/analytics.js
mvpkit-1.1.0 project/app/webpack/javascripts/lib/analytics.js