Jack Jackson abab21e297 Self-host upload to Google Analytics
Some client configurations (Browsers with tracking-blocking enabled, or
networks with [Pi-holes](https://pi-hole.net/)) will block any calls
to `www.google-analytics.com`. This makes me sad! I'd like to know
how many folks are reading my blog!

This commit represents a workaround. Instead of telling the client to
send data directly to Google (which would trigger Tracking-blockers), I
instead tell the client to send it to the `/analytics` endpoint on my
domain, which will then get forwarded to Google. Neat!

But! If a reader has blocked tracking, we should respect that! So I'm
not actually enabling this in my blog until I have also built an
"opt-in" mechanism, where readers can decide if they want to send me
tracking information or not.

"Why didn't you make tracking opt-in to begin with, Jack?" - well, I
kinda addressed that
[here](https://blog.scubbo.org/posts/commenting-enabled/), but you're
right that that would have been a little more ethical. Still - enabling
Google Analytics didn't feel _too_ bad (since anyone who cared about
detecting and blocking it would still be able to with standard methods -
and I assume that anyone reading my blog will know how to), whereas this
new approach feels like a circumvention of their agency.
2022-05-04 14:45:20 -07:00
2022-05-04 14:45:20 -07:00
2021-11-07 20:54:06 -08:00
2021-12-13 21:43:20 -08:00

Installation

  • Install hugo (if you have set up your pi with pi-tools, this will already be done):
    • latestHugoVersion=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases | jq -r '.[] | .tag_name' | perl -pe 's/^v//' | sort -V | tail -n 1)
    • wget -q -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${latestHugoVersion}/hugo_${latestHugoVersion}_Linux-ARM.deb
    • sudo apt install /tmp/hugo.deb
  • git submodule init && git submodule update --recursive

Use

Content is stored in blog/. All hugo commands below should be executed from there. This top-level directory is just for package metadata, README.md, etc.

  • To create a new post, run hugo new posts/<name>.md (or, run np.sh <name> from the root directory)
  • To start a local server to check how it looks, run hugo server (with -D to show drafts)
Description
No description provided
Readme 8.2 MiB
Languages
CSS 52.4%
HTML 43.6%
JavaScript 3.8%
Dockerfile 0.2%