Skip to content

Commit cbd7c57

Browse files
committed
Remove script, emded gtag script directly
1 parent 4542cb7 commit cbd7c57

2 files changed

Lines changed: 11 additions & 21 deletions

File tree

src/analytics/google-analytics.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/layouts/Layout.astro

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,18 @@ const isAbout = pageTitle === 'About';
4646
}
4747
</script>
4848
<script
49-
is:inline
5049
type='text/partytown'
51-
src='../analytics/google-analytics.js'></script>
50+
async
51+
src='https://www.googletagmanager.com/gtag/js?id=G-LF96D9G25P'></script>
52+
<script type='text/partytown'>
53+
window.dataLayer = window.dataLayer || [];
54+
function gtag() {
55+
dataLayer.push(arguments);
56+
}
57+
gtag('js', new Date());
58+
59+
gtag('config', 'G-LF96D9G25P');
60+
</script>
5261
</head>
5362
<body class='flex min-h-screen flex-col pt-16 bg-white dark:bg-dark-bg'>
5463
<Header pageTitle={pageTitle} />

0 commit comments

Comments
 (0)