TIL: You can add a custom domain to your Goatcounter site

When you create an account on Goatcounter and add a new site, you can view the analytics by going to [sitecode].goatcounter.com. For example, haseebmajid.goatcounter.com. However, we can use a custom domain, to view your analytics.

Custom Domain You will need a domain, that you can control the DNS of to do the following!

Goatcounter

We can do this by:

  • First go to your Goatcounter site
    • i.e. haseebmajid.goatcounter.com
  • Then go to Settings
  • Then Domain settings > Custom domain
    • Add your domain
      • i.e. stats.haseebmajid.dev
  • Press the Save button on the bottom left

Domain

Finally, we need to go to our domain management tool, such as namecheap and add a new entry:

  • CNAME stats.haseebmajid.dev haseebmajid.goatcounter.com
Certificate It can up to an hour for the certificate to be created so try to visit your page in an hour.