How to use Google webmaster tools stats with Excel
Google’s webmaster tools has a neat feature that lets you download your query and click statistics (once you have verified ownership of your site). The data you can get from there is quite comprehensive, but hard to break down for use in Excel. As a fun exercise I put together a small Python-script that takes the CSV file downloaded from your webmaster tools account and turns it into new CSV files for queries and for clicks (both with the position numbers as well).
Python is a neat little programming language, I like it more and more as I use it
.
Here’s how to get started:
- If you do not have Python installed, go and download and install Python. I assume most Apple OSX will have it installed, but I don’t have a Mac so I can’t say for sure. It’ll almost certainly be installed if you’re one of the 3 Linux-users who have visited my blog. If you’re using Windows, take the version with the installer (it’s easier) and make sure that the folder where you installed Python is in your “path”.
- Grab my wmtextract01.zip and extract it into a folder. You should have three files: wmtextract.py (the Python script) and ProcessAll.bat + ProcessAll.py.
- Copy your query stats CSV files into that folder as well.
- Double-click on ProcessAll.py (or ProcessAll.bat if you’re on Windows and don’t have Python set up to run scripts directly)
- The script will now process all CSV files in the same folder, create a new folder called “output” and place the new CSV files there.
- Open the new CSV files in Excel (or Open Office or even Google Docs + Spreadsheets)
- Enjoy
Here are some more ideas for the CSV files when you have them in Excel:
- Select everything (Ctrl-A) and set up an “AutoFilter” (menu item Data / Filter / AutoFilter). Now you can filter your stats however you want them. Want to only see the queries for which you rank #1? How about the queries that people from Switzerland used to find your site?

- Set the Location to “All locations” and search type to “All searches”, now select everything and sort by the last column (menu Data / Sort / has header row / sort by Column E, ascending). Now select the last two columns (D and E) and click on the chart icon. Choose an “XY scatter” chart and let it create it. This chart shows you the ranking of your site for the search queries. There are some problems with the chart like this (keywords can be listed several times), but I think it’s neat anyway

What’s the neatest information you ever found in your webmaster tools query stats?
Hi John,
Tried to download the zip file here : http://johnmu.com/files/wmtextract.zip , but I got a “Error 404 - Not Found” page
Sorry about that, I just fixed the link - it should go to http://johnmu.com/files/wmtextract01.zip instead. Thanks!
Let me know if you guys are interested in a simple Windows EXE file instead of the Python script.
Sign me up for EXE.
Now if we could cross pregnate this with the log file tool…
BTW - how/why was my captcha pre-populated?
How do you mean that, Richard? Display the rankings in the log file tool? I’m not sure how useful that would be since the log file tool will probably show more phrases…
The captcha is pre-populated via javascript :). I noticed it keeps the bots out just as well.
couldn’t see the script for JS…
remember the small log reading app you built that spat out reports of what buttons people used on Google etc. I know this wouldn’t relate to exporting sitemaps data, but I always found that to be quite a cute little app. Actually this makes no sense even to my deranged mind - ignore
Here’s the normal Windows executable version: http://johnmu.com/files/WmtExtractW01.zip
This executable opens a window, lets you choose the stats-file you downloaded and then generates the clicks and queries files separately.
It needs the Microsoft .NET Framework v2.0, which you probably already have installed, but just in case, you can get it directly from Microsoft at http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5
Let me know if you run into any problems!
John, that’s an awesome piece of script. I’m trying to bring in URL matching to bounce rates from G Analytics for some super targeted page tweaking actions.
Awesome, thanks soo much for this utility!
How can I add Month ranges in the excel? So, basically I want it to sort it by month. Also, I want it to sort keyword position by Top 10.
Thanks
Ankit