Remove Google Analytics.
Google shut down the Universal Analytics script that the pages loaded, and we haven't used it probably a decade
This commit is contained in:
@@ -23,9 +23,6 @@ RECAPTCHA_SITE_KEY=
|
|||||||
RECAPTCHA_PROJECT_ID=
|
RECAPTCHA_PROJECT_ID=
|
||||||
RECAPTCHA_API_KEY=
|
RECAPTCHA_API_KEY=
|
||||||
|
|
||||||
# Google Analytics tracking ID. Leave it empty to turn analytics off.
|
|
||||||
GOOGLE_ANALYTICS_ID=
|
|
||||||
|
|
||||||
# Directory for uploaded images waiting to be saved. Keep it outside the
|
# Directory for uploaded images waiting to be saved. Keep it outside the
|
||||||
# web root. The default is xxx-uploads in the system temporary directory.
|
# web root. The default is xxx-uploads in the system temporary directory.
|
||||||
UPLOAD_DIR=
|
UPLOAD_DIR=
|
||||||
|
|||||||
@@ -2,4 +2,3 @@
|
|||||||
All stories and submissions <a class="whitefont" href="about">©</a> 2003–<?php echo gmdate("Y"); ?> their respective authors.
|
All stories and submissions <a class="whitefont" href="about">©</a> 2003–<?php echo gmdate("Y"); ?> their respective authors.
|
||||||
</p></footer>
|
</p></footer>
|
||||||
<?php $_SESSION['referrer'] = $_SERVER['REQUEST_URI']; ?>
|
<?php $_SESSION['referrer'] = $_SERVER['REQUEST_URI']; ?>
|
||||||
<?php include_once('google.inc.php'); ?>
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
$ga_id = config('GOOGLE_ANALYTICS_ID');
|
|
||||||
if (! $is_admin && $ga_id) { ?>
|
|
||||||
<script>
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
|
|
||||||
ga('create', <?= json_encode($ga_id, JSON_HEX_TAG) ?>, 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
</script>
|
|
||||||
<?php } ?>
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace Xxx\Tests\Pages;
|
||||||
|
|
||||||
|
use Xxx\Tests\Support\PageTestCase;
|
||||||
|
|
||||||
|
// The site has no Google Analytics, even with the old GOOGLE_ANALYTICS_ID in the environment
|
||||||
|
class NoAnalyticsTest extends PageTestCase {
|
||||||
|
protected static function serverEnv(): array {
|
||||||
|
return array('GOOGLE_ANALYTICS_ID' => 'UA-12345-1');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testNoPageLoadsAnalytics(): void {
|
||||||
|
foreach (array('/', '/article', '/about', '/publish', '/publish/login') as $path) {
|
||||||
|
$body = $this->get($path)['body'];
|
||||||
|
$this->assertStringNotContainsString('UA-12345-1', $body, $path);
|
||||||
|
$this->assertStringNotContainsString('google-analytics', $body, $path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ SITE_URL=https://site.test
|
|||||||
RECAPTCHA_SITE_KEY=test-site-key
|
RECAPTCHA_SITE_KEY=test-site-key
|
||||||
RECAPTCHA_PROJECT_ID=test-project
|
RECAPTCHA_PROJECT_ID=test-project
|
||||||
RECAPTCHA_API_KEY=test-api-key
|
RECAPTCHA_API_KEY=test-api-key
|
||||||
GOOGLE_ANALYTICS_ID=
|
|
||||||
UPLOAD_DIR=
|
UPLOAD_DIR=
|
||||||
UPLOAD_DIR_LIMIT_MB=1
|
UPLOAD_DIR_LIMIT_MB=1
|
||||||
DISPLAY_ERRORS=
|
DISPLAY_ERRORS=
|
||||||
|
|||||||
Reference in New Issue
Block a user