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 d53c8de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<head>
<meta charset="utf-8" />
<title>SCUMM NES resource explorer</title>
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-eval' getinsights.io" />
<link
rel="stylesheet"
href="css/base.css" />
Expand Down Expand Up @@ -34,13 +37,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 d53c8de

Please sign in to comment.