Skip to content

Commit

Permalink
Use the analytics in prod only 📊.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Apr 20, 2024
1 parent 71c8132 commit 16f28b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@
}
})(window.location);
</script>
<script src="https://getinsights.io/js/insights.js"></script>
<script
type="module"
src="index.js"></script>
<script src="https://getinsights.io/js/insights.js"></script>
<script>
insights.init('OTy7QFoUv4bUuKzo');
insights.trackPages();
</script>
</head>
</html>
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ root.render(
<App />
</BrowserRouter>,
);

if (process.env.NODE_ENV === 'production') {
// Load the analytics.
insights.init('OTy7QFoUv4bUuKzo');
insights.trackPages();
}

0 comments on commit 16f28b4

Please sign in to comment.