Hosting a Static Website on GCP Storage - Getting Started on My First Try

Want to host a static website on Google Cloud Storage but don’t know where to start? Every time I upload files to Google Cloud Storage to share with friends, I have to click “Public,” which is a hassle, right? I looked into this for a few days because of a work requirement. At first I thought I just needed to set up the domain and share the files, but after researching, I found there are many little tricks. For example, having to make every uploaded file public is really annoying, but you can set a bucket so that new uploads are public by default. You can even set the default file names for the index and 404 pages. And even the SSL problem that I thought had no solution: the official docs offer a good workaround! ...

April 10, 2017 · 3 min

Google Analytics Exception Tracking

Google Analytics has a hidden feature called exception tracking. It collects error messages from a website’s front end or back end (or from an app) so you can analyze them. Here’s an example from my recent project. When a user fills out a form and submits it, I validate the information they entered. If they forgot to fill in a field, the error message is sent to GA. Afterward, I check how many times that error message appeared in GA. To some extent, this can suggest whether the interface design is poor and causing users to skip that field. ...

February 19, 2017 · 2 min

Shared Links Not Showing Up as Expected on Facebook? Here's How to Optimize Your Site for Facebook!

For every webmaster, Facebook has become just as important a traffic source as Google. In the past, we did a lot of SEO work for search engines, but did you know that Facebook has also published a document, “Best Practices for Sharing Websites and Mobile Apps,” that explains how to adjust your web pages so they are displayed in the best way when users share them on Facebook? In this article, I’ll share what I tried on my personal blog. ...

February 18, 2017 · 5 min

Worried About Visitors Copying Your Articles? Use JS to Automatically Append a Reminder or Disable Copying!

Many content sites have a mechanism that automatically appends the original article URL when text is copied, such as Mojing Lyrics and Zhihu. Some sites even ban users from copying text altogether. Achieving these features isn’t difficult; it only takes a few lines of simple JavaScript. But first you should think about whether your site really needs such a feature. When a regular visitor copies text and pastes it into Facebook, does that really harm your site? And if you truly want to stop visitors from copying text, these tricks only keep out the honest, not the determined. Are you really protecting your interests, or just making your site harder to use? ...

February 12, 2017 · 4 min

Lessons in E-commerce Flow Optimization from My Shopping Experience at udn Books

Perhaps because of the pressure from Amazon’s e-books, Taiwanese publishers have become more willing in recent years to offer e-book purchase options. A few days ago I wanted to read Zheng Feng’s Chronicles of Strange Peaks and Stones, and I found that udn Books actually sells the e-book. Although you have to bind it to udn’s own app, and the files can’t be downloaded (Kobo offers an EPUB with DRM download), at least I could read it at home at my leisure. Who knew that after I pressed the buy button I would run into so many problems? I’d like to take this chance to share them. ...

January 30, 2017 · 13 min

Possible Causes and Fixes for the "HTTP Error" When Uploading Files in WordPress

If you use WordPress, you may occasionally run into the “HTTP error” problem when uploading images. Search online and you’ll find all sorts of explanations — some say it’s a file permission issue, others say you need to add a snippet of code to your theme. In fact, all of these are “possible” causes. The most correct approach is to check the server’s error log to determine what the actual cause is. I happened to run into this problem today, so let me put together my solution along with other possible causes! ...

January 30, 2017 · 4 min

Google Analytics Tips: Let Annotations Tell Your Future Self Why Traffic Goes Up and Down!

Every time you redesign your website or run an experiment, your Google Analytics data changes. For example, the bounce rate might go up. You may remember the reason for a big change in traffic or data for a short while. But if a year goes by, can you still remember why? Just as code needs comments, Google Analytics has a built-in annotation feature that lets you write notes on specific dates. That way, when you read your reports, you’ll understand what happened to cause the change in traffic! ...

January 29, 2017 · 2 min

A Simple Approach to Scheduling Bulk Newsletter Sends and Handling Yahoo Deferrals

When you send a large newsletter, have you ever thought about how to send it? Say you have 10,000 addresses. Would you send them all at once, or spread them out over different times? Most people send them all at once, and that’s usually fine. If your sender reputation is good and you do this regularly, sending bulk email is normal for email providers, and the messages almost always land in the inbox. But there’s one troublemaker: Yahoo. For some reason, if you send too many emails in a short period, they get deferred (temporarily rejected). You can retry, and after a few tries they usually go through. The most I’ve seen is one that only got through after being resent 100 times. Looking at the Yahoo situation, it seems that no matter how good your reputation is, you run into deferrals when you send at high frequency in a short time, regardless of content. Here I tried several approaches to solve the problem. ...

January 12, 2017 · 4 min

An Explanation of the Recent Site Outage

I think many of you noticed that my site was unreachable for the whole day yesterday. Let me explain what happened. It was definitely not because I wanted to give up on the blog XD. The night before last, while I was writing a post, I logged into the wrong host. I have two servers: one for the site and one for writing posts. While I was writing, I accidentally logged into the site server and made some changes there. I didn’t realize my mistake until I finished the post… So the server that runs the site got messed up. The Apache configuration file was overwritten, and unluckily I had no backup of it. I had only backed up the site folder and the database, and I never imagined I would do something this stupid XD. So the site went down for a whole day… ...

August 5, 2011 · 2 min

The Blog Is Moving to a New Host, DirectSpace, and I May Not Be Able to Write Posts from 7/11 to 7/15

Let me recall: about half a year ago, I couldn’t put up with the stability and performance of the shared hosting service Bumeng, so I switched to renting a semi-managed VPS from a company called PhotonVPS. Since it was my first time trying a VPS, I was worried I would regret it, so at the time I only paid for half a year. Then yesterday (7/7), the six-month VPS contract expired, so I moved the site to another VPS provider, called DirectSpace. ...

July 8, 2011 · 3 min