<commit_before>(ns frontend.analytics.google
  (:require [frontend.utils :as utils :include-macros true]))

(defn push [args]
  (let [gaq (aget js/window "_gaq")]
     ((aget gaq "push") (clj->js args))))

(defn track-event [& args]
  (utils/swallow-errors (push (cons "_trackEvent" args))))

(defn track-pageview [& args]
  (utils/swallow-errors (push (cons "_trackPageview" args))))<commit_msg>fix _gaq.push before the script has finished loading<commit_after>(ns frontend.analytics.google
  (:require [frontend.utils :as utils :include-macros true]))

(defn push [args]
  (let [gaq (aget js/window "_gaq")
        push (aget gaq "push")]
     (.call push gaq (clj->js args))))

(defn track-event [& args]
  (utils/swallow-errors (push (cons "_trackEvent" args))))

(defn track-pageview [& args]
  (utils/swallow-errors (push (cons "_trackPageview" args))))
{'fraction_non_alphanumeric': 0.16763678696158324, 'fraction_numerical': 0.0, 'mean_word_length': 4.584415584415584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1660166', 'n_tokens_mistral': 307, 'n_tokens_neox': 305, 'n_words': 84}