<commit_before> // mathiasbynens.be/notes/async-analytics-snippet
var _gaq = [["_setAccount", mzalendo_settings.google_analytics_account], ["_trackPageview"]];
(function(d, t) {
  var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
  g.async = 1;
  g.src = ("https:" == location.protocol ? "//ssl" : "//www") + ".google-analytics.com/ga.js";
  s.parentNode.insertBefore(g, s)
}(document, "script"));<commit_msg>Add in tracking of when users print pages.<commit_after> // mathiasbynens.be/notes/async-analytics-snippet
var _gaq = [["_setAccount", mzalendo_settings.google_analytics_account], ["_trackPageview"]];
(function(d, t) {
  var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
  g.async = 1;
  g.src = ("https:" == location.protocol ? "//ssl" : "//www") + ".google-analytics.com/ga.js";
  s.parentNode.insertBefore(g, s)
}(document, "script"));

// add in some tracking to detect when users print pages. Will be used to judge
// how often this happens.


(function() {
  // based on code from http://stackoverflow.com/a/11060206/5349  

  // track the print request - with debounce for chrome.
  var haveTracked = false;
  var beforePrint = function() {
    if (haveTracked)
      return;
    haveTracked = true;
    var args = ['_trackEvent', 'Sharing', 'Print', document.location.pathname];
    // console.log(args)
    _gaq.push(args);
  };

  // respond to print events
  if (window.matchMedia) {
    var mediaQueryList = window.matchMedia('print');
    mediaQueryList.addListener(function(mql) {
      if (mql.matches) {
        beforePrint();
      }
    });
  }
  window.onbeforeprint = beforePrint;

}());
{'fraction_non_alphanumeric': 0.16646341463414635, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 3.6885714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4024267', 'n_tokens_mistral': 573, 'n_tokens_neox': 559, 'n_words': 125}