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:
tim
2026-09-26 15:27:51 +02:00
parent 77800174c9
commit 65426a327d
5 changed files with 19 additions and 18 deletions
+19
View File
@@ -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);
}
}
}