Skip to content

Commit

Permalink
Update to new Plausible proxy methods (#1572)
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
marxian authored Oct 29, 2023
1 parent 3c7cb01 commit be22665
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

1 comment on commit be22665

@vercel
Copy link

@vercel vercel bot commented on be22665 Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.