View count is available

Last modified: less than 1 minute read, with 138 words. Post views:

Update on 2024-03-101

I changed to this service.

Original post

As you can see in the subtitle of this post, as well as the bottom-right corner of the homepage, view counts for this site and for individual posts are now available.

Just like the comment function, to have view counts on a static page require external services. We use 不蒜子, with tutorials here. It is quiet easy to use, with only two steps:

  1. Add a js script to every page, like this.
  2. Add a span element to the html to show page counts, like this.

Please note that some browsers will prohibit cross-site tracking (e.g. Safari browser) which will cause inaccurate page view counts. This can’t be fixed at the website side, instead you have to configure manually following this. Some related discussions are available here and here.


Tags: ,

Categories:

Comments