Skip to content

Commit 2c925c4

Browse files
authored
add analytics (#714)
add analytics - closes #706
1 parent 3e184b5 commit 2c925c4

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

apps/svelte.dev/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@testing-library/svelte": "^5.2.3",
2929
"@testing-library/user-event": "^14.5.2",
3030
"@types/d3-geo": "^3.1.0",
31+
"@vercel/analytics": "^1.3.2",
3132
"@vercel/speed-insights": "^1.0.0",
3233
"@webcontainer/api": "^1.1.5",
3334
"adm-zip": "^0.5.10",

apps/svelte.dev/src/routes/+layout.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<script lang="ts">
22
import '@sveltejs/site-kit/styles/index.css';
3-
import { browser } from '$app/environment';
3+
import { browser, dev } from '$app/environment';
44
import { page } from '$app/stores';
55
import { Shell, Banner } from '@sveltejs/site-kit/components';
66
import { Nav } from '@sveltejs/site-kit/nav';
77
import { SearchBox } from '@sveltejs/site-kit/search';
88
import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit';
9+
import { inject } from '@vercel/analytics';
910
import { beforeNavigate } from '$app/navigation';
1011
1112
injectSpeedInsights();
13+
inject({ mode: dev ? 'development' : 'production' });
1214
1315
// Make all navigations between SvelteKit-tutorial and non-SvelteKit-tutorial pages (and vice versa)
1416
// a full page navigation to ensure webcontainers get the correct origin restriction headers while

pnpm-lock.yaml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)