<commit_before>//module for interfacing with GA
//automatically fires GA tracking on click/touch, require it for custom events
//NOTE: requires the _adFoot partial to load for GTM (embedded: false in project.json)

//ensure dataLayer exists
if (!window.dataLayer) {
  window.dataLayer = [];
}

/**
@param [category] - usually "interaction"
@param action - what happened
@param [label] - not usually visible in dashboard, defaults to title or URL
*/
var track = function(category, action, label) {
  if (!action) {
    action = category;
    category = "interaction";
  }
  label = label || document.title || window.location.href;
  window.dataLayer.push({
    event: "analyticsEvent",
    eventCategory: category,
    eventAction: action,
    eventLabel: label
  });
};

//set up default tracking events
["click", "touchstart"].forEach(e => track.bind(null, `interactive-page-${e}`));

var oneScroll = function() {
  track("interactive-page-scrolled");
  window.removeEventListener("scroll", oneScroll);
};
window.addEventListener("scroll", oneScroll);

module.exports = track;
<commit_msg>Removed click/touch tracking events that probably never fired.<commit_after>//module for interfacing with GA
//automatically fires GA tracking on click/touch, require it for custom events
//NOTE: requires the _adFoot partial to load for GTM (embedded: false in project.json)

//ensure dataLayer exists
if (!window.dataLayer) {
  window.dataLayer = [];
}

/**
@param [category] - usually "interaction"
@param action - what happened
@param [label] - not usually visible in dashboard, defaults to title or URL
*/
var track = function(category, action, label) {
  if (!action) {
    action = category;
    category = "interaction";
  }
  label = label || document.title || window.location.href;
  window.dataLayer.push({
    event: "analyticsEvent",
    eventCategory: category,
    eventAction: action,
    eventLabel: label
  });
};

//set up default tracking events
var oneScroll = function() {
  track("interactive-page-scrolled");
  window.removeEventListener("scroll", oneScroll);
};
window.addEventListener("scroll", oneScroll);

module.exports = track;

{'fraction_non_alphanumeric': 0.12668840242198418, 'fraction_numerical': 0.0, 'mean_word_length': 4.343283582089552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5601111', 'n_tokens_mistral': 610, 'n_tokens_neox': 602, 'n_words': 199}