Skip to content

Commit 2b84f93

Browse files
Remove Google Analytics integration
1 parent 923b1a5 commit 2b84f93

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/routes/+layout.svelte

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,8 @@
44
PUBLIC_SITE_URL,
55
PUBLIC_GITHUB_USERNAME,
66
PUBLIC_LINKED_IN_USERNAME,
7-
PUBLIC_FIVERR_USERNAME,
8-
PUBLIC_GOOGLE_ANALYTICS_ID
7+
PUBLIC_FIVERR_USERNAME
98
} from '$env/static/public';
10-
import { onMount } from 'svelte';
11-
12-
const gaId = PUBLIC_GOOGLE_ANALYTICS_ID;
13-
14-
// Google Analytics
15-
onMount(() => {
16-
if (!gaId) return;
17-
18-
// Load GA script
19-
const script1 = document.createElement('script');
20-
script1.setAttribute('async', '');
21-
script1.src = `https://www.googletagmanager.com/gtag/js?id=${gaId}`;
22-
document.head.appendChild(script1);
23-
24-
// Init GA
25-
const script2 = document.createElement('script');
26-
script2.innerHTML = `
27-
window.dataLayer = window.dataLayer || [];
28-
function gtag(){dataLayer.push(arguments);}
29-
gtag('js', new Date());
30-
gtag('config', '${gaId}');
31-
`;
32-
document.head.appendChild(script2);
33-
});
349
</script>
3510

3611
<svelte:head>

0 commit comments

Comments
 (0)