Workaround Google Maps review link not working in Firefox Android using Nginx

My family owns a small business, and I wanted to distribute some review links for their Google Maps profile. I’m a devoted Firefox User, so I quickly found out that apparently, Google makes the page not work on Firefox Android. But I found a server-side workaround.

This is no new issue, people have reported odd behaviour on Firefox for a long time, and this bug specifically has been mentioned multiple times:

The fault seems to be pretty clearly with Google, since many people suggest using Google Search Fixer, and all this plugin does is lie to websites and pretend we are using google Chrome instead of Firefox.

Of course, I cannot tell every client that uses firefox to first install an extension before scanning a QR code, but I also don't want to serve broken webpages to clients, even if they are a minority. So I devised a plan.

I already have the VPS that runs this website running nginx, I can send everyone to a link on this server, and then redirect them based of the User-Agent they reported:

  • If they are using anything except Firefox Android, send them directly to the review link google provides, they will be greeted with pretty page ready with textbox type their review.
  • If they are using Firefox, I forward them to our Google Maps page, and they will have to manually find the "Leave a review" button. Not good, but better than an error.

Here is the nginx configuration that achieves this:

   location /redirect/greview {
        if ($http_user_agent ~* 'Mobile.*Firefox') {
            return 301 https://www.google.com/maps?cid=9500000000000000063;
        }
        return 301 https://g.page/r/AAAAAAAAAAAAAAAAAAA6A6EEBE/review;
    }

This block goes inside your normal server block, and then you point clients to https://example.com/redirect/greview or whatever location you use.

The process is transparent, nginx will quickly return the HTTP return code for redirecting the client, the only downside is the extra delay, be cause people have to talk to my server instead of going directly to Google, but at least no one is served a broken page.

I hope this solution can help other small business owners that don't to serve a broken user experience to their clients.

Leave a Reply

Your email address will not be published. Required fields are marked *