Skip to content

Commit

Permalink
Update to new Plausible proxy methods
Browse files Browse the repository at this point in the history
We use a same-domain proxy for our Plausible anlytics to reassure
privacy tools that we control our data carefully.

THe support for doing this in Plausible changed from DNS level changes
to preferring local proxies. This is well-supported by next-plausible:
https://plausible.io/docs/proxy/guides/nextj
  • Loading branch information
Rupert Redington committed Oct 3, 2023
1 parent 8670c37 commit 1f4d0c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,9 @@ const withNextAnalyser = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});

// https://plausible.io/docs/proxy/guides/nextjs
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withPlausibleProxy } = require('next-plausible');

// eslint-disable-next-line functional/immutable-data
module.exports = withNextAnalyser(moduleExports);
module.exports = withNextAnalyser(withPlausibleProxy(moduleExports));
5 changes: 1 addition & 4 deletions src/components/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ const Providers: React.FC<{ children: React.ReactNode }> = ({ children }) => {
}, [disableDynamicMediaQueries]);

return (
<PlausibleProvider
domain="toiletmap.org.uk"
customDomain="https://stats.toiletmap.org.uk/"
>
<PlausibleProvider domain="toiletmap.org.uk">
<MapStateProvider>
{globalStyles}
<ThemeProvider theme={theme}>
Expand Down

0 comments on commit 1f4d0c7

Please sign in to comment.