You can push events without any library. Just use measurment protocol: https://developers.google.com/analytics/devguides/collection/protocol/v1/ Here is how I do it form server side:
<?php
$data = array(
'v=' . 1,
't=' . 'approved', //Page
'tid=' . 'UA-XXXXXXXX-X', //GA account code
'cid=' . $ga_user_id, // 1267034788.1479821336 needs to be extracted from $_COOKIE['_ga']
'ec=' . 'credit', // for event only - event category
'ea=' . 'denied', // for event only - event action
'el=' . '12345', // for event only - event label
);
$ch = curl_init('www.google-analytics.com/collect');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
Here is builder tool that I've been using for url building: https://ga-dev-tools.appspot.com/hit-builder/