Added Matomo to the website for analytics

This commit is contained in:
2022-03-04 20:42:18 -05:00
parent cc68553b30
commit 68f74f71dd
4 changed files with 60 additions and 23 deletions

View File

@@ -45,7 +45,7 @@
<h3>Permanent Upgrades</h3>
<div id='reset'></div>
</div>
<button class='red' onclick="completeReset()">Reset Game Completely</button>
<div class='red'><button onclick="completeReset()">Reset Game Completely</button></div>
</div>
</body>

View File

@@ -1,22 +1,39 @@
<?php
include 'functions.php';
// Contains the favicon, the css stylesheet, meta tags, and js
echo '<meta charset="utf=8" />
<meta property="og:site_name" content="lschaefer" />
<meta http-equiv="content-language" content="en-us">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/website.css" />
<script type="text/javascript" src="/javascript/jquery.js"></script>
<script type="text/javascript" src="/javascript/jquery-ui.min.js"></script>
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script type="text/javascript" src="/javascript/functions.js"></script>
<script type="text/javascript" src="/javascript/cookie.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> ';
?>
<meta charset="utf=8" />
<meta property="og:site_name" content="lschaefer" />
<meta http-equiv="content-language" content="en-us">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/website.css" />
<script type="text/javascript" src="/javascript/jquery.js"></script>
<script type="text/javascript" src="/javascript/jquery-ui.min.js"></script>
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script type="text/javascript" src="/javascript/functions.js"></script>
<script type="text/javascript" src="/javascript/cookie.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.lschaefer.xyz/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<?php
if ($MOBILE) { // Tells javascript if this is a mobile user
echo "<script type='text/javascript'>var mobile = true</script>";
} else {

View File

@@ -1,5 +1,24 @@
<?php
$MENUITEMS = [["Main Page", "/index.php"], ["Internet", "/internet/index.php"], ["Dice Game", "/diceGame/index.php"], ["Space 3", "/space3/index.php"], ["Idle Bouncer", "/idleBouncer/index.php"], ["Golf", "/golf/index.php"], ["Cookie Clicker Addon", "/cookieClicker/index.php"], ["Floppy", "/floppy.php"], ["Soccer", "/soccer.php"], ["privilege", "docker", "/docker/index.php", "Docker Containers"], ["privilege", "dockerAdmin", "/docker/admin.php", "Docker Admin"], ["Electricity Log", "/electricity.php"], ["privilege", "viewLog", "/log/index.php", "Server Log"], ["privilege", "viewBackup", "/backup/index.php", "Backups"], ["privilege", "mail", "/email/index.php", "Email"], ["user", "/usermenu/index.php", "User Menu"], ["user", "/usermenu/key.php", "Session Manager"], ["notUser", "/login.php", "Login/Signup"], ["user", "/login.php", "Logout"], ["Uptime", "https://uptime.lschaefer.xyz/status"]];
$MENUITEMS = [["Main Page", "/index.php"],
["Internet", "/internet/index.php"],
["Dice Game", "/diceGame/index.php"],
["Space 3", "/space3/index.php"],
["Idle Bouncer", "/idleBouncer/index.php"],
["Golf", "/golf/index.php"],
["Cookie Clicker Addon", "/cookieClicker/index.php"],
["Floppy", "/floppy.php"],
["Soccer", "/soccer.php"],
["privilege", "docker", "/docker/index.php", "Docker Containers"],
["privilege", "dockerAdmin", "/docker/admin.php", "Docker Admin"],
["Electricity Log", "/electricity.php"],
["privilege", "viewLog", "/log/index.php", "Server Log"],
["privilege", "viewBackup", "/backup/index.php", "Backups"],
["privilege", "mail", "/email/index.php", "Email"],
["user", "/usermenu/index.php", "User Menu"],
["user", "/usermenu/key.php", "Session Manager"],
["notUser", "/login.php", "Login/Signup"],
["user", "/login.php", "Logout"],
["Uptime", "https://uptime.lschaefer.xyz/status"]];
echo "<div class='vertical-menu'>";
function menuItem($link, $name)
{

View File

@@ -1,19 +1,20 @@
$(document).ready(function() {
if (localStorage.cookie_accept != "true") {
if (localStorage.cookies_accept != "true") {
let div = document.createElement('div');
div.className = "popup";
div.id = "cookie_popup";
div.innerHTML = `<div class='popup-content'>
<h1>Cookie Policy</h1>
<p>This website uses cookies to function properly. Currently all cookies are strictly functional or to save your preferences locally. Your preferences will never be saved on our server. This also uses Cloudflare's CDN. If you want to see exactly what the cookies are used for <a href="https://github.com/Lukasdotcom/website" target="_blank" rel="noopener noreferrer" >click here</a> to see the source code of the website.</p>
<button id='accept_cookies'>Click here to Accept Cookies</button>
<button id='decline_cookies'>Click here to decline cookies and go back to previous page</button>
<p>This website uses cookies to function properly. Most cookies are strictly functional and your preferences will never be saved on our server. This also uses Cloudflare's CDN. If you want to see exactly what the cookies are used for <a href="https://github.com/Lukasdotcom/website" target="_blank" rel="noopener noreferrer" >click here</a> to see the source code of the website.
This website also uses mastodon you may disable mastodon analytics by clicking this <a href="https://analytics.lschaefer.xyz/index.php?module=CoreAdminHome&action=optOut&language=en&backgroundColor=000000&fontColor=ffffff&fontSize=17px&fontFamily=" target="_blank" rel="noopener noreferrer" >link</a> and unchecking the check box.</p>
<button id='accept_cookies'>Click here to accept functional cookies</button>
<div class="red"><button id='decline_cookies'>Click here to decline all cookies and go back to previous page</button></div>
</div>`;
$("body").append(div);
$("#cookie_popup").show();
$("#accept_cookies").click(function() {
$("#cookie_popup").hide();
localStorage.cookie_accept = true;
localStorage.cookies_accept = true;
})
$("#decline_cookies").click(function() {
window.history.go(-1)