Add google analytics to config

This commit is contained in:
jvyden 2021-12-10 14:36:03 -05:00
commit e09a9fa832
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 18 additions and 1 deletions

View file

@ -51,6 +51,19 @@
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
@if (ServerSettings.Instance.GoogleAnalyticsEnabled)
{
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=@ServerSettings.Instance.GoogleAnalyticsId"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '@ServerSettings.Instance.GoogleAnalyticsId');
</script>
}
</head> </head>
<body> <body>
<div class="pageContainer"> <div class="pageContainer">

View file

@ -63,7 +63,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
} }
} }
public const int CurrentConfigVersion = 10; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! public const int CurrentConfigVersion = 11; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
#region Meta #region Meta
@ -102,5 +102,9 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
public int EntitledSlots { get; set; } = 50; public int EntitledSlots { get; set; } = 50;
public int ListsQuota { get; set; } = 50; public int ListsQuota { get; set; } = 50;
public bool GoogleAnalyticsEnabled { get; set; } = false;
public string GoogleAnalyticsId { get; set; } = "";
} }
} }