diff --git a/public/app/features/admin/ServerStats.test.tsx b/public/app/features/admin/ServerStats.test.tsx
index 4c1d85d189c..b658800f12b 100644
--- a/public/app/features/admin/ServerStats.test.tsx
+++ b/public/app/features/admin/ServerStats.test.tsx
@@ -52,6 +52,7 @@ describe('ServerStats', () => {
it('Should render page with anonymous stats', async () => {
config.featureToggles.displayAnonymousStats = true;
+ config.anonymousEnabled = true;
config.anonymousDeviceLimit = 10;
render();
expect(await screen.findByRole('heading', { name: /instance statistics/i })).toBeInTheDocument();
diff --git a/public/app/features/admin/ServerStats.tsx b/public/app/features/admin/ServerStats.tsx
index acb1ae19644..4e94e8a6a4e 100644
--- a/public/app/features/admin/ServerStats.tsx
+++ b/public/app/features/admin/ServerStats.tsx
@@ -100,7 +100,7 @@ export const ServerStats = () => {
};
const getAnonymousStatsContent = (stats: ServerStat | null, config: GrafanaBootConfig) => {
- if (!config.featureToggles.displayAnonymousStats || !stats?.activeDevices) {
+ if (!config.anonymousEnabled || !config.featureToggles.displayAnonymousStats || !stats?.activeDevices) {
return [];
}
if (!config.anonymousDeviceLimit) {
diff --git a/public/app/features/admin/UserListPage.tsx b/public/app/features/admin/UserListPage.tsx
index 98bf8a200fb..838031fe760 100644
--- a/public/app/features/admin/UserListPage.tsx
+++ b/public/app/features/admin/UserListPage.tsx
@@ -78,7 +78,7 @@ export default function UserListPage() {
onChangeTab={() => setView(TabView.ORG)}
data-testid={selectors.tabs.orgUsers}
/>
- {config.featureToggles.displayAnonymousStats && (
+ {config.anonymousEnabled && config.featureToggles.displayAnonymousStats && (