I'm experiencing difficulties with Google Analytics while using the angular plugin angular-google-analytics. I keep encountering this error:
Refused to load the script 'http://www.google-analytics.com/analytics.js' because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
I've realized that removing the phonegap meta TAG from my header resolves this error:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
I'm unsure of the significance of this meta TAG or why it was necessary. Anyhow, even after fixing the error, I don't see any activity in the realtime view.
gameApp.controller('MainController', function($scope, $location, Analytics) {
$scope.$on('$routeChangeStart', function(next, current) {
Analytics.trackPage($location.path());
});
});
Could you assist me in resolving these issues? Thank you.