Common JS Analytics function with Callback
var $ = window.jQuery;
/**
* Passes arguments into the ga event sender
* @param {String} category [description]
* @param {String} action [description]
* @param {String} label [description]
* @param {Function} cb [description]
*/
function track(category, action, label, cb) {
cb = cb || false;
window.ga('send', 'event', category, action, label, {
'hitCallback' : function() {
if(cb) {
cb();
}
}
});
}
module.exports = track;