Monday, December 24, 2018

Custom domain for Google MyBusiness websites

Unfortunately there is no way of setting a custom domain for websites created using the tools provided by Google MyBusiness, except ordering the domain via Google. That however is only possible in some countries at the moment, so it is not an option for some...

To solve that issue I created an app for CloudFlare, which makes your Google MyBusiness website appear under your own domain without confusing the user. You can find and install the app for free here. Read on to know why I think this is a good solution for a bad problem.

When looking at this problem I saw only two reasonable solutions: 1. forwarding your domain to the domain provided by Google (ending in . business.site) and 2. using an iFrame to load the website "within your website) without the user noticing. While the latter is not a perfect solution either, forwarding your domain creates a very bad user experience because the user starts his journey by typing in your domain but suddenly ends up on a possibly very different domain. This can cause confusion and a feeling that something went wrong for the user.

Implementing the iFrame-approach was more complicated than expected because it is not a commonly used solution. That's why I took the opportunity to learn more about CloudFlare apps and use them to solve my problem. The app automatically creates a DNS entry pointing to a server which hosts a very small HTML template. The CloudFlare app uses that to load the iFrame using the website of your choice (i.e. Google MyBusiness website).

There is an opportunity to get rid of the server, but that would require CloudFlare workers. Since they are not free I don't expect them to have a very big customer base so I decided not to limit my app unnecessarily.

Installing the app is literally as easy as clicking "Install" on CloudFlare and telling the app which website to redirect to. That of course requires your domain's DNS to be managed by CloudFlare, which I suggest anyway.