Add Google Analytics.

This commit is contained in:
2020-06-10 18:09:44 +01:00
parent 9c34bbbc56
commit 0faa688ef4
4 changed files with 36 additions and 0 deletions

View File

@@ -9,5 +9,6 @@
<orderEntry type="library" name="all" level="application" />
<orderEntry type="library" name="jquery-3.3.1.slim" level="application" />
<orderEntry type="library" name="popper.js" level="application" />
<orderEntry type="library" name="analytics" level="application" />
</component>
</module>

View File

@@ -162,6 +162,10 @@
<Content Include="..\TODO.md">
<Link>TODO.md</Link>
</Content>
<Content Update="wwwroot\js\ga.js">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Delete.cshtml" />

View File

@@ -44,6 +44,8 @@
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
<script crossorigin="anonymous" src="https://ssl.google-analytics.com/analytics.js" async id="ga"></script>
<script src="js/ga.js"></script>
</head>
<body>
<app>

29
Marechai/wwwroot/js/ga.js Normal file
View File

@@ -0,0 +1,29 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
window.addEventListener('load', function () {
ga('create', 'UA-XXXXXXXX-1', 'auto')
ga('send', 'pageview')
})