Skip to content

Commit d587ee6

Browse files
Added analytics script
1 parent 77d7849 commit d587ee6

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ DATABASE_URL="file:db/db.sqlite"
77
# For Sentry Error Handling
88
VITE_SENTRY_DSN=""
99

10+
VITE_ANALYTICS_SCRIPT=""
11+
VITE_ANALYTICS_WEBSITE_ID=""
12+
1013
# Umami Analytics
1114
UMAMI_DATABASE_URL=postgresql://umami:umami@umami-db:5432/umami
1215
UMAMI_APP_SECRET=some-long-random-secret

src/routes/__root.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ export const Route = wrapCreateRootRouteWithSentry(
3838
href: appCss,
3939
},
4040
],
41+
scripts: [
42+
{
43+
defer: true,
44+
src: import.meta.env.VITE_ANALYTICS_SCRIPT,
45+
"data-website-id": import.meta.env.VITE_ANALYTICS_WEBSITE_ID,
46+
},
47+
],
4148
}),
4249
component: RootComponent,
4350
});

0 commit comments

Comments
 (0)