I've implemented this solution for page tracking in Google Analytics with Angular2 https://stackoverflow.com/a/39622860/4155124 and it works well.
How could I use
ga('send', {
hitType: 'event',
eventCategory: 'Some Category',
eventAction: 'Level Completed',
eventLabel: 'Level 3'
});
within a component?
This code works within the component but there is a "cannot find ga" error in the console.