Privacy Focused Blog Services
Tags: blogging
Published: 2022-02-01 08:43:43

---
title: Privacy Focused Blog Services
published: true
date: 2022-01-28 11:51:41 UTC
tags: blogging
canonical_url: https://www.alexhyett.com/privacy-focused-blog-services/
cover_image: https://www.alexhyett.com/static/766ddc769f189a9ae69a63e155513c83/G5cyebOF7.jpeg
---

Towards the end of 2021, I started getting into [web3](https://www.alexhyett.com/what-is-web3/) a lot more. Not only did I join the [Developer DAO](https://www.developerdao.com/) but I also launched my [own NFT collection](https://www.sleepyslothclub.com/) and wrote a few blog posts on the topic.

One of the key components of web3 is the ownership of data. In web 2.0, our data is owned by the likes of Facebook, Google and Apple. We have no control over our own data and in most cases, these companies are profiting from it.

Now my blog is a static website created using [Gatsby.js](https://www.alexhyett.com/building-a-blog-with-gatsbyjs/). The lack of an underlying database has meant I have had to rely on 3rd party services for analytics and comments.

Until recently, I have been using Google Analytics for tracking the number of visitors and Disqus for my commenting system. However, both of these companies track their users and are profiting from the data they collect. As a web3 advocate, I felt a bit hypocritical writing about all the benefits but still using these services that are tracking data.

So at the end of 2021, I switched to privacy-focused services that don’t collect identifiable information on visitors.

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#plausible-analytics)Plausible Analytics

I don’t know the exact statistic but I imagine the majority of the web has Google Analytics running on it. As a result, Google is able to collect an enormous amount of data on the websites you visit and can track your movements around the web.

Obviously, as a simple user, I am not able to identify individual people on my site but Google can, especially if you have a Google account too.

Google Analytics has a dizzying number of features but ultimately there are only a few data points I care about:

- How many people are visiting my site?
- What posts are they reading?
- Where did they come from?

Possibly in the future when I have products I might want to know how many of my visitors convert into paid users.

[Plausible Analytics](https://plausible.io/) does all of this without compromising the privacy of the users of my site.

Now Plausible Analytics isn’t free at £9 a month but not only are you protecting your user’s privacy you are also helping out an indie development team. Plausible is developed by a small 2 man team [Uku Täht](https://twitter.com/ukutaht) and [Marko Saric](https://twitter.com/markosaric) and it is nice to be able to support them rather hand more money over to Google. Plausible also give you the first 2 months free so you can see whether it is the right tool for you.

I also much prefer the dark dashboard compared to Google Analytics:

![Plausible Analytics](https://cdn.hashnode.com/res/hashnode/image/upload/v1643367454039/Yh2Lt13CO.png)

I have been really impressed with Plausible. I wish they had a mobile app and widgets but the dashboard is mobile friendly so it isn’t a big loss.

Plausible is simple to set up, it is just a case of adding the javascript to your site. It is also a smaller script than Google Analytics so it will help your website performance as well.

I always found it ironic that Google’s Page Speed was always asking me to fix the Google Analytics script due to its size.

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#giscus)Giscus

When I switched from WordPress to Gatsby, I needed to add a third-party comment system. [Disqus](https://disqus.com/) is very easy to set up but requires users to sign in and will often try and add adverts if you don’t turn them off. I am sure there is a fair amount of data collection that goes on as well.

The downside of comment systems is they cannot be completely anonymous as otherwise, you will end up with a lot of spam on your website.

When I was hunting around for alternatives I found [utterances](https://utteranc.es/). Utterances is open-source and uses GitHub to store your comments. It seemed perfect but I wasn’t keen on the fact that conversations were being stored as issues.

I then found [Giscus](https://giscus.app/) a fork of utternances that uses GitHub discussions for the storage mechanism. If you look at the sites you will see they are basically identical in how they work.

![Giscus](https://cdn.hashnode.com/res/hashnode/image/upload/v1643370258435/j2M0vF3rjcs.png)

You still need a GitHub account to be able to comment but as a developer-focused site, it is likely the majority of my users probably would have one anyway.

### [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#issues-with-setup)Issues with setup

I did hit a few roadblocks when setting up Giscus. The main issue was with the way I had my website set up.

I currently have my website hosted on AWS with my static website hosted in an S3 bucket and CloudFront as my CDN.

When I first tried to sign in to GitHub to comment I would get redirected back to my website but it will still tell me I needed to sign in. The issue was there was a redirect happening which was causing the query string containing the token to get dropped.

First I made sure I enabled query string forwarding in my CloudFront distribution. That didn’t help by itself but I guessed was needed anyway.

In an S3 website if you visit a page hosted in a folder without specifying the trailing slash it will redirect you to the trailing slash version. When it does this, it drops the query string. To me, this seems like a bug with the way S3 hosted sites work, either way, we need to work around it.

The trick is to add a function to your CloudFront distribution that will add the trailing slash for you before it passed to the S3 bucket.

To do this, you go to the Behaviour section of your CloudFront distribution. I have a default behaviour added already to redirect HTTP to HTTPS so I just added to this. If you scroll to the bottom of your behaviour you will find a section called Function association.

![Function association](https://cdn.hashnode.com/res/hashnode/image/upload/v1643369372648/ZEFUpDxVC.png)

Your lambda needs to be hosted in `us-east-1` to be able to use it with CloudFront.

In my case, I only need to add a slash if it wasn’t there. This is what my code looks like:

```
const path = require('path');
exports.handler = async (event) => {
  const { request } = event.Records[0].cf;
  const { uri } = request;
  const extension = path.extname(uri);
  if (extension && extension.length > 0) {
    return request;
  }
  const last_character = uri.slice(-1);
  if (last_character === "/") {
    return request;
  }
  const newUri = `${uri}/`;
  console.log(`Rewriting ${uri} to ${newUri}...`);
  request.uri = newUri;
  return request;
};

```

You can test your lambda in the console before publishing and hooking up to your CloudFront distribution.

A big thank you to Sean Devine for his post on this, [Add Trailing Slash to AWS CloudFront Request](https://www.barelyknown.com/posts/add-trailing-slash-to-cloudfront-request)