A poor man's Alexa ranking dashboardCopy article link Sure, there are many expensive tools out there to track the competition of your website. But maybe you just want a quick idea of the amount of traffic competing sites get and don't care too much about the details yet. That was me, so I built a Google Sheets dashboard that scrapes Alexa rankings.
Getting a list of competitors
You may already know who your main competitors are, but there are probably more than you're aware of. Luckily, it's quite simple to find them. The most obvious way is to just Google for the terms you want to rank for, visit all the sites on the first page and check if they are similar to your site.
Once you have a couple of domain names, look up their Alexa page and look for "similar sites by audience overlap" and "top keywords by traffic". Rinse and repeat until you feel like the results aren't relevant anymore.
Depending on the niche, that should give you a list of your 10 to 20 most important competitors.
Fetching Alexa ranks in Google Sheets
Google Sheets has a function that fetches the content of a web page: IMPORTXML. The following formula fetches the Alexa rank page, and uses an xpath query to extract the relevant section.
=IMPORTXML(CONCAT(CONCAT(CONCAT("https://www.alexa.com/siteinfo/", A2), "?"), $A$23), "//head/script")
Because Sheets decides when it's time to re-download the page, and update the cell's content, I've included a query parameter to make the URL unique. This way, we can change the value of a single cell to refresh the ranks of all your competitors.
=VALUE(REGEXEXTRACT(D2, "global.: (\d*)"))
Now we'll do a simple regex to extract the rank and voilà!