How to know if your website is in Google's mobile-first index ?
Watch your server logs easily with Unix command-line tools.
By Julien on December 15, 2017
In a recent hangout, Google’s John Mueller told webmasters to watch their server logs, in order to know if a website has been moved to the mobile first index.
This kind of monitoring can easily be done with a few Unix command-line tools, as long as you know where to find your log files.
First, we’ll filter our log file to keep only the lines corresponding to any Googlebot:
You should see loads of lines stream on your screen. Stop the process by typing ctrl
+c
.
We’ll now use awk
to feep only the User-agent from each line. The -F
argument sets the field separator, while '{print $6}'
prints only the 6th field of each line (in our case, the User-agent). Let’s try this:
Loads of lines streaming again, but only with User-agents. Everything is working fine :-)
Finally, let’s count how many visits we got from each UA. We’ll just sort
the stream, then count duplicate lines:
This displays the count of visits per User-agent: simply compare volumes for desktop and mobile Googlebots.
Here is what I get on one of my sites:
Still in desktop index !