mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-23 05:39:20 +08:00
Google Analytics - Simplified retrieving Tag ID from Status Page.
This commit is contained in:
@@ -54,14 +54,12 @@ class StatusPage extends BeanModel {
|
|||||||
|
|
||||||
const head = $("head");
|
const head = $("head");
|
||||||
|
|
||||||
await StatusPage.getStatusPageData(statusPage).then( (page) => {
|
if (statusPage.googleAnalyticsTagId) {
|
||||||
if (page.config?.googleAnalyticsId) {
|
let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId), {
|
||||||
let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(page.config.googleAnalyticsId), {
|
"isScriptContext": true
|
||||||
"isScriptContext": true
|
});
|
||||||
});
|
head.append($(escapedGoogleAnalyticsScript));
|
||||||
head.append($(escapedGoogleAnalyticsScript));
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// OG Meta Tags
|
// OG Meta Tags
|
||||||
head.append(`<meta property="og:title" content="${statusPage.title}" />`);
|
head.append(`<meta property="og:title" content="${statusPage.title}" />`);
|
||||||
|
Reference in New Issue
Block a user