Re:Replace Google Analytics with a shell script
by kevinyew on Saturday April 17, 2021 @11:12PM
(#26849534)
I wish there was something like this for JAMstack/JS only websites that you host on eg Netlify. I know Netlify has their own analytics but they're paid, which is fair enough, but hard to bite the bullet when Google Analytics is free.
[ Parent
| on HN ]
Re:Replace Google Analytics with a shell script
by nindalf on Sunday April 18, 2021 @02:38AM
(#26850324)
I believe Cloudflare’s analytics are free. I use it because they don’t set cookies and don’t share the collected data with anyone.
Re:Replace Google Analytics with a shell script
by hanniabu on Sunday April 18, 2021 @11:00AM
(#26853052)
I'm using netlify by building directly from github. How would I go about inserting cloudflare into this?
Re:Replace Google Analytics with a shell script
by nindalf on Sunday April 18, 2021 @11:05AM
(#26853091)
I think you can sign up for a Cloudflare account and add the JS snippet they mention to your site. It’ll look like
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "$SITE_TOKEN"}'></script>
Re:Replace Google Analytics with a shell script
by hanniabu on Sunday April 18, 2021 @03:35PM
(#26855592)
Ahhh okay thanks thought it had to be done by using cf as a cdn or something.
Re:Replace Google Analytics with a shell script
by nindalf on Sunday April 18, 2021 @04:13PM
(#26855901)
Totally understandable that you would think that. Cloudflare also provides server analytics if you use them as a CDN. That doesn't work for single page apps which don't necessarily make server requests when the URL changes, so they introduced a new product ("Web Analytics") to handle this.