Skip to content

Commit 94616bd

Browse files
AaronAxhelAxhelAaronAxhelAxhel
authored andcommitted
Published your App
Replit-Commit-Author: Deployment Replit-Commit-Session-Id: 51380c82-6139-4a22-aacf-aff8420fcda1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ccc0ccec-8ae2-4b0a-9d50-0fe01698faf0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/211e9931-d664-40e8-84e1-6444686dbb62/51380c82-6139-4a22-aacf-aff8420fcda1/smUe01k Replit-Commit-Deployment-Build-Id: 46bf31d5-7fa5-469d-8ec5-ce50be86dc31 Replit-Helium-Checkpoint-Created: true
1 parent 15b7735 commit 94616bd

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/Analytics.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
22
const GA_MEASUREMENT_ID = import.meta.env.PUBLIC_GA_MEASUREMENT_ID;
3+
if (!GA_MEASUREMENT_ID) {
4+
console.warn("Google Analytics is disabled — PUBLIC_GA_MEASUREMENT_ID is missing.");
5+
}
36
---
47

58
{GA_MEASUREMENT_ID && (
69
<>
710

8-
<!-- Google tag (gtag.js) -->
911
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WT3SXHD497"></script>
1012
<script>
1113
window.dataLayer = window.dataLayer || [];
@@ -16,4 +18,4 @@ const GA_MEASUREMENT_ID = import.meta.env.PUBLIC_GA_MEASUREMENT_ID;
1618
</script>
1719

1820
</>
19-
)}
21+
)}

src/layouts/BaseLayout.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ const currentPath = Astro.url.pathname;
5959
<slot />
6060
</main>
6161
<Footer />
62+
<Analytics />
6263
</body>
6364
</html>

0 commit comments

Comments
 (0)