jspm install npm:system-script
import 'www.google-analytics.com/analytics.js!system-script'
The example above loads google analytics via a script tag instead of a XHR request which avoid CORS issues.
Note that as of SystemJS 0.17 the functionality in this plugin can be achieved via the following config:
System.config({
...
meta: {
"ga": {
"scriptLoad": true,
"format": "global",
"exports": "ga"
}
},
map: {
"ga": "//www.google-analytics.com/analytics.js"
}
});
MIT