Let say we want to track custom event, ajax events on the front end generally couldn't be tracked. Though its possible to write separate code to track these ajax request but It will be nice have all in done by one module. This feature can be extended simply writing a few lines of code, for eg -
//extending statcommAppend
function statcommAppend( $ajax_request='' ) {
....
if( !empty($ajax_request) ) { ...insert $ajax_request to db }
}
add_action( 'track_event', 'statcommAppend', 5, 1 );
//later we can call
do_action( 'track_event', $event );
This will have a custom do_action call at our disposal to be used on any events we want to track...