Skip to content

Commit

Permalink
🚀 Add tracking with Google Analytics 4 (#367)
Browse files Browse the repository at this point in the history
Closes #248.
  • Loading branch information
ezwelty committed Jul 5, 2023
1 parent 401c3b2 commit 47be0b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ REACT_APP_API_URL=https://fallingfruit.org/api/0.3
REACT_APP_API_KEY=AKDJGHSD
REACT_APP_RECAPTCHA_SITE_KEY=6Ld99kUdAAAAAAB5nCofKrQB6Vp-e5wR42u5TNZZ
REACT_APP_GOOGLE_MAPS_API_KEY=
REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID=
11 changes: 11 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
-->

<title>Falling Fruit</title>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=%REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID%">
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '%REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID%');
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down

0 comments on commit 47be0b6

Please sign in to comment.