From c08d8a5eaffc5b707ddb9a59d1125c44cb425c53 Mon Sep 17 00:00:00 2001 From: c Date: Sun, 22 Jan 2023 16:59:09 +0000 Subject: [PATCH] Google Analytics - Simplified retrieving Tag ID from Status Page. --- server/model/status_page.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/server/model/status_page.js b/server/model/status_page.js index a65a7da1b..5b1c12408 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -54,14 +54,12 @@ class StatusPage extends BeanModel { const head = $("head"); - await StatusPage.getStatusPageData(statusPage).then( (page) => { - if (page.config?.googleAnalyticsId) { - let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(page.config.googleAnalyticsId), { - "isScriptContext": true - }); - head.append($(escapedGoogleAnalyticsScript)); - } - }); + if (statusPage.googleAnalyticsTagId) { + let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId), { + "isScriptContext": true + }); + head.append($(escapedGoogleAnalyticsScript)); + } // OG Meta Tags head.append(``);