I came across an article by David Walsh and just wanted to expand on the topic. When implementing this feature watch out for the differences between analytics.js and ga.js. The code below is works with analytics.js. Another thing to be aware of is that some errors will be created from Adblocker. I thought of adding the logic but I didn't want to leave it up to chance that I might accidentally ignore some real errors. Instead what you can did is just filter it in Google Analytics and aggregate against with the number hits.
Using in Google Analytics
Under Real-Time or Behavior look at Events -> Overview, for testing purposes use the real-time at least once to make sure everything is working properly.
With David Walsh's snippet it includes jquery ajax calls but what about angular http calls? I'm still looking at this and for ways to test it.