Skip to content

Commit ef33408

Browse files
feat: Add Plausible analytics with site-specific script
- Updated PlausibleAnalytics component with Plausible's provided script - Fixed FROM_EMAIL branding in .env.example 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e381991 commit ef33408

2 files changed

Lines changed: 19 additions & 22 deletions

File tree

website/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ NEXT_PUBLIC_STRIPE_PRICE_CONTRIB_500=price_...
4343
RESEND_API_KEY=re_...
4444

4545
# Email addresses
46-
FROM_EMAIL=Empathy Framework <noreply@smartaimemory.com>
46+
FROM_EMAIL=Empathy <noreply@smartaimemory.com>
4747
SUPPORT_EMAIL=admin@smartaimemory.com
4848

4949
# ===========================================

website/components/PlausibleAnalytics.tsx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,25 @@
22

33
import Script from 'next/script';
44

5-
interface PlausibleAnalyticsProps {
6-
domain?: string;
7-
apiHost?: string;
8-
}
9-
10-
export default function PlausibleAnalytics({
11-
domain = process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN,
12-
apiHost = process.env.NEXT_PUBLIC_PLAUSIBLE_API_HOST || 'https://plausible.io',
13-
}: PlausibleAnalyticsProps) {
14-
if (!domain) {
15-
console.warn('Plausible Analytics: NEXT_PUBLIC_PLAUSIBLE_DOMAIN is not set');
16-
return null;
17-
}
18-
5+
export default function PlausibleAnalytics() {
196
return (
20-
<Script
21-
defer
22-
data-domain={domain}
23-
data-api={`${apiHost}/api/event`}
24-
src={`${apiHost}/js/script.js`}
25-
strategy="afterInteractive"
26-
/>
7+
<>
8+
<Script
9+
async
10+
src="https://plausible.io/js/pa-5FMhEzOX6RnEF6ncz16Tr.js"
11+
strategy="afterInteractive"
12+
/>
13+
<Script
14+
id="plausible-init"
15+
strategy="afterInteractive"
16+
dangerouslySetInnerHTML={{
17+
__html: `
18+
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
19+
plausible.init()
20+
`,
21+
}}
22+
/>
23+
</>
2724
);
2825
}
2926

0 commit comments

Comments
 (0)