Cookies: Provide a mechanism for per user control over cookies (#61566)
This commit is contained in:
+11
-4
@@ -48,6 +48,13 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagIndividualCookiePreferences) {
|
||||
if !prefs.Cookies("analytics") {
|
||||
settings.GoogleAnalytics4Id = ""
|
||||
settings.GoogleAnalyticsId = ""
|
||||
}
|
||||
}
|
||||
|
||||
// Locale is used for some number and date/time formatting, whereas language is used just for
|
||||
// translating words in the interface
|
||||
acceptLangHeader := c.Req.Header.Get("Accept-Language")
|
||||
@@ -110,10 +117,10 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
Theme: prefs.Theme,
|
||||
AppUrl: appURL,
|
||||
AppSubUrl: appSubURL,
|
||||
GoogleAnalyticsId: setting.GoogleAnalyticsId,
|
||||
GoogleAnalytics4Id: setting.GoogleAnalytics4Id,
|
||||
GoogleAnalytics4SendManualPageViews: setting.GoogleAnalytics4SendManualPageViews,
|
||||
GoogleTagManagerId: setting.GoogleTagManagerId,
|
||||
GoogleAnalyticsId: settings.GoogleAnalyticsId,
|
||||
GoogleAnalytics4Id: settings.GoogleAnalytics4Id,
|
||||
GoogleAnalytics4SendManualPageViews: hs.Cfg.GoogleAnalytics4SendManualPageViews,
|
||||
GoogleTagManagerId: hs.Cfg.GoogleTagManagerID,
|
||||
BuildVersion: setting.BuildVersion,
|
||||
BuildCommit: setting.BuildCommit,
|
||||
NewGrafanaVersion: hs.grafanaUpdateChecker.LatestVersion(),
|
||||
|
||||
Reference in New Issue
Block a user