Skip to content

Commit

Permalink
Remove Plausible Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Feb 9, 2024
1 parent e83e5df commit 235d432
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
}
}
6 changes: 0 additions & 6 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import '@app/fonts';
import '@styles/index.scss';
import '@styles/landing-page.scss';
import Script from 'next/script';
import React from 'react';

export default function RootLayout({
Expand All @@ -16,11 +15,6 @@ export default function RootLayout({
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<Script
defer
data-domain="faithdashboard.com"
src="https://plausible.io/js/script.js"
></Script>
</head>
<body>{children}</body>
</html>
Expand Down
13 changes: 2 additions & 11 deletions app/privacy-policy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,8 @@ async function PrivacyPolicy() {
<h2>Analytics</h2>

<p>
Faith Dashboard uses{' '}
<a href="https://plausible.io/">Plausible Analytics</a>, a
privacy-focused analytics platform. We only use this information to
examine traffic trends and aggregated visitor statistics (i.e. the
percentage of Chrome users, or the total number of people who viewed a
particular project). However, you would need to read the{' '}
<a href="https://plausible.io/data-policy">
Plausible Analytics data policy
</a>
to understand how Plausible collects and uses this information. I do not
otherwise share this information.
As of Februrary 9th, 2024, Faith Dashboard no longer collects any
analytics.
</p>

<h2>Email Privacy</h2>
Expand Down
2 changes: 1 addition & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { Database } from './components/database.types';
// <https://stackoverflow.com/questions/76270173/can-a-nonce-be-used-for-multiple-scripts-or-not>)
function generateCSP() {
const nonce = crypto.randomUUID();
return `default-src 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://hcaptcha.com https://*.hcaptcha.com; font-src 'self' https://fonts.gstatic.com data:; img-src * data:; script-src 'self' 'nonce-${nonce}' https://storage.googleapis.com https://plausible.io https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com; child-src 'self' https://challenges.cloudflare.com; connect-src *; manifest-src 'self'; media-src *;`;
return `default-src 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://hcaptcha.com https://*.hcaptcha.com; font-src 'self' https://fonts.gstatic.com data:; img-src * data:; script-src 'self' 'nonce-${nonce}' https://storage.googleapis.com https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com; child-src 'self' https://challenges.cloudflare.com; connect-src *; manifest-src 'self'; media-src *;`;
}

// Source:
Expand Down
13 changes: 3 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@ const withPWA = require('next-pwa')({
// 'SKIP_WAITING'}." (source:
// https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin.GenerateSW#GenerateSW)
skipWaiting: false,
runtimeCaching: [
// Fix bad-precaching-response errors from service worker due to use of
// middleware (source: https://github.com/shadowwalker/next-pwa/issues/291)
...runtimeCaching,
// Fix no-response errors for Plausible analytics script
{
urlPattern: /^https:\/\/plausible\.io\//i,
handler: 'NetworkOnly'
}
],
// Fix bad-precaching-response errors from service worker due to use of
// middleware (source: https://github.com/shadowwalker/next-pwa/issues/291)
runtimeCaching,
buildExcludes: [
// This is necessary to prevent service worker errors; see
// <https://github.com/shadowwalker/next-pwa/issues/424#issuecomment-1399683017>
Expand Down

0 comments on commit 235d432

Please sign in to comment.