<commit_before>App.addChild('MixPanel', {
  el: 'body',

  activate: function(){
    this.VISIT_MIN_TIME = 10000;
    this.user = null;
    this.contributions = null;
    this.controller = this.$el.data('controller');
    this.action = this.$el.data('action');
    if(window.mixpanel){
      this.startTracking();
    }
  },

  startTracking: function(){
    this.trackSelectedReward();
    if(this.controller == 'projects' && (this.action == 'show' || this.action == 'index')){
      this.trackUserVisit();
    }
    if(this.controller == 'contributions' && this.action == 'show'){
      this.trackOnMixPanel("Visited thank you");
    }
  },

  identifyUser: function(){
    this.user = this.$el.data('user');
    this.contributions = this.$el.data('contributions');
    if (this.user){
      mixpanel.name_tag(this.user.id + '-' + this.user.name);
      mixpanel.identify(this.user.id);
    }
  },

  trackOnMixPanel: function(text, options){
    this.identifyUser();
    var obj             = $(this);
    var usr             = (this.user != null) ? this.user.id : null;
    var contributions   = (this.user != null) ? this.user.created_at : null;
    var created_at      = (this.user != null) ? this.contributions : null;
    var ref             = (obj.attr('href') != undefined) ? obj.attr('href') : null;
    var opt             = options || {};
    var default_options = {
      'page name':  document.title,
      'user_id':    usr,
      'created_at': created_at,
      'contributions': contributions,
      'project':    ref,
      'url':        window.location
    };
    var opt     = $.fn.extend(default_options, opt);

    mixpanel.track(text, opt);
  },

  mixPanelEvent: function(target, event, text, options){<commit_msg>fixed MixPanel variables<commit_after>App.addChild('MixPanel', {
  el: 'body',

  activate: function(){
    this.VISIT_MIN_TIME = 10000;
    this.user = null;
    this.contributions = null;
    this.controller = this.$el.data('controller');
    this.action = this.$el.data('action');
    if(window.mixpanel){
      this.startTracking();
    }
  },

  startTracking: function(){
    this.trackSelectedReward();
    if(this.controller == 'projects' && (this.action == 'show' || this.action == 'index')){
      this.trackUserVisit();
    }
    if(this.controller == 'contributions' && this.action == 'show'){
      this.trackOnMixPanel("Visited thank you");
    }
  },

  identifyUser: function(){
    this.user = this.$el.data('user');
    this.contributions = this.$el.data('contributions');
    if (this.user){
      mixpanel.name_tag(this.user.id + '-' + this.user.name);
      mixpanel.identify(this.user.id);
    }
  },

  trackOnMixPanel: function(text, options){
    this.identifyUser();
    var obj             = $(this);
    var usr             = (this.user != null) ? this.user.id : null;
    var created_at      = (this.user != null) ? this.user.created_at : null;
    var contributions   = (this.user != null) ? this.contributions : null;
    var ref             = (obj.attr('href') != undefined) ? obj.attr('href') : null;
    var opt             = options || {};
    var default_options = {
      'page name':  document.title,
      'user_id':    usr,
      'created_at': created_at,
      'contributions': contributions,
      'project':    ref,
      'url':        window.location
    };
    var opt     = $.fn.extend(default_options, opt);

    mixpanel.track(text, opt);
  },

  mixPanelEvent: function(target, event, text, options){
{'fraction_non_alphanumeric': 0.16575853168913104, 'fraction_numerical': 0.0028677946659019216, 'mean_word_length': 2.6220145379023885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6256730', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1101, 'n_words': 211}