fix so that google analytics script are cached

This commit is contained in:
Marcus Efraimsson 2018-04-26 15:49:22 +02:00
parent 1dd4f03100
commit ddeba41638
No known key found for this signature in database
GPG Key ID: EBFE0FB04612DD4A

View File

@ -7,7 +7,11 @@ export class Analytics {
constructor(private $rootScope, private $location) {}
gaInit() {
$.getScript('https://www.google-analytics.com/analytics.js'); // jQuery shortcut
$.ajax({
url: 'https://www.google-analytics.com/analytics.js',
dataType: 'script',
cache: true,
});
var ga = ((<any>window).ga =
(<any>window).ga ||
function() {