Merge pull request #11736 from grafana/11735_ga

fix so that google analytics script are cached
This commit is contained in:
Marcus Efraimsson 2018-04-26 16:01:08 +02:00 committed by GitHub
commit 28781e7dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,11 @@ export class Analytics {
constructor(private $rootScope, private $location) {} constructor(private $rootScope, private $location) {}
gaInit() { 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 = var ga = ((<any>window).ga =
(<any>window).ga || (<any>window).ga ||
function() { function() {