<commit_before>/**
 * @module  ga
 * @author  <NAME> <<EMAIL>>
 */

/**
 * @property config
 * @property {Boolean} 	config.dryRun		Enable debug mode. This will prevent sending data to Google Analytics.
 * @type {Object}
 */
exports.config = _.extend({
}, Alloy.CFG.T ? Alloy.CFG.T.ga : {});

var Util = require('T/util');

var AnalyticsGoogle = Util.requireOrNull('ti.ga');
var tracker = null;

function track(method, what) {
	if (tracker === null) return;
	if (_.isEmpty(what)) return;

	try {
		tracker['add' + method](what);
	} catch (err) {
		Ti.API.error('GA: Error while calling method ' + method, err);
	}
}

/**
 * Track an event
 * @param  {String} cat 	Category **or object passed to native proxy**
 * @param  {String} act 	The action
 * @param  {String} [lbl=""] 	Label
 * @param  {String} [val=0]	Value
 */
exports.trackEvent = function(cat, act, lbl, val){<commit_msg>Added log option<commit_after>/**
 * @module  ga
 * @author  <NAME> <<EMAIL>>
 */

/**
 * @property config
 * @property {String} [config.log=false] Log the queries
 * @type {Object}
 */
exports.config = _.extend({
	log: false
}, Alloy.CFG.T ? Alloy.CFG.T.ga : {});

var Util = require('T/util');

var AnalyticsGoogle = Util.requireOrNull('ti.ga');
var tracker = null;

function track(method, what) {
	if (tracker === null) return;
	if (_.isEmpty(what)) return;

	if (exports.config.log === true) {
		Ti.API.trace("GA: Track", method, what);
	}

	try {
		tracker['add' + method](what);
	} catch (err) {
		Ti.API.error('GA: Error while calling method ' + method, err);
	}
}

/**
 * Track an event
 * @param  {String} cat 	Category **or object passed to native proxy**
 * @param  {String} act 	The action
 * @param  {String} [lbl=""] 	Label
 * @param  {String} [val=0]	Value
 */
exports.trackEvent = function(cat, act, lbl, val){
{'fraction_non_alphanumeric': 0.18206972883231876, 'fraction_numerical': 0.0011068068622025456, 'mean_word_length': 3.720626631853786, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5346547', 'n_tokens_mistral': 658, 'n_tokens_neox': 642, 'n_words': 182}