Made the matomo domain changeable in the enviromental variables
This commit is contained in:
@@ -4,6 +4,8 @@ require __DIR__ . '/../vendor/autoload.php'; # Loads all composer files
|
||||
$jsonInfo = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/config.json");
|
||||
$jsonData = json_decode($jsonInfo, true);
|
||||
$developer = $jsonData["developer"];
|
||||
$MATOMO_DOMAIN = $jsonData["matomoDomain"];
|
||||
$MATOMO_SITE_ID = $jsonData["matomoSiteId"];
|
||||
if ($developer) {
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
@@ -22,9 +24,9 @@ $MATOMO = "<!-- Matomo -->
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u=`//analytics.lschaefer.xyz/`;
|
||||
var u=`//$MATOMO_DOMAIN/`;
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
_paq.push(['setSiteId', '$MATOMO_SITE_ID']);
|
||||
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);
|
||||
})();
|
||||
|
||||
0
html/logic/index.js
Normal file → Executable file
0
html/logic/index.js
Normal file → Executable file
0
html/logic/index.php
Normal file → Executable file
0
html/logic/index.php
Normal file → Executable file
@@ -82,7 +82,9 @@ try:
|
||||
[["throttle"], int(os.getenv("WEBSITE_THROTTLE", "5"))],
|
||||
[["throttleTime"], int(os.getenv("WEBSITE_THROTTLE_TIME", '30'))],
|
||||
[["fanStart"], int(os.getenv("WEBSITE_FAN_START", '43'))],
|
||||
[["fanStop"], int(os.getenv("WEBSITE_FAN_STOP", '35'))]
|
||||
[["fanStop"], int(os.getenv("WEBSITE_FAN_STOP", '35'))],
|
||||
[["matomoDomain"], os.getenv("MATOMO_DOMAIN", 'example.com')],
|
||||
[["matomoSiteId"], int(os.getenv("MATOMO_SITE_ID", '1'))],
|
||||
]
|
||||
if os.path.exists(location + "/config.json"):
|
||||
configuration = readFile(location + "/config.json")
|
||||
|
||||
Reference in New Issue
Block a user