OK, so I've resolved this. The cordova plugin does indeed work, just not with a browser (despite the presence of a "browser" implementation in the plugin). Guess that's what the Ionic 2 plugin is for. I also needed to disable debugMode.
I found the easiest way to track views was to hook into the state transition event. I just shoved a GA trackView() call into this function at the bottom of core/components/sidemenu/services/sidemenu.js:
.run(function($rootScope, $mmSideMenu, $cordovaGoogleAnalytics) {
// Hide right side menu everytime we change state.
$rootScope.$on('$stateChangeStart', function(event, toState) {
// Check we're not loading split view contents.
if (toState.name.split('.').length == 2) {
$mmSideMenu.hideRightSideMenu();
}
//wrap in try/catch because running in browser throws an exception due to plugin not being loaded
try {
console.log("********* Tracking state change to " + toState.name);
$cordovaGoogleAnalytics.trackView(toState.name);
} catch (exception) {
console.log(exception.message);
}
});
});
This will track all states as GA screens. Keep in mind this won't track external links opened in the browser, and it won't be able to distinguish different courses or different sections of the same course, so you may want to manually add tracking code for those.