Downloading Medium statistics

Library for Educators
5 min readDec 9, 2020

This guide will show you how to download the statistics for the stories in a Medium account.

For this to work you’ll need to be using the Google Chrome browser.

1. Downloading Medium stats using Google Chrome

Visit medium.com and log on to your Medium account.

Click on your user account icon (top right) then click ‘Stats’.

Open Chrome’s ‘Developer Tools by clicking the three vertical dots in the top right-hand corner of your browser then choose ‘More tools > Developer tools’.

Accessing Developler Tools in Google Chrome browser
  • Windows shortcut — Ctrl+Shift+I
  • MacOS shortcut — alt(⌥)+cmd(⌘)+I

In the Developer tools window click ‘Console’.

Download code

(Amended original code by: Epintos on GitHub)

Select the code below and copy it.

// Run Inspector Console in chrome and copy and paste the following code in the /stats/stories viewfunction download(filename, text) {
var pom = document.createElement('a');
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
pom.setAttribute('download', filename);
if (document.createEvent) {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
pom.dispatchEvent(event);
}
else {
pom.click();
}
}
content = "";
content += "Story" + "," + "Views" + "," + "Reads" + "," + "readRatio" + "," + "Fans" + "\n"
rows = document.querySelectorAll(".sortableTable-row.js-statsTableRow")
rows.forEach(function(row) {
title = row.querySelectorAll(".sortableTable-title > a")[0].innerText
values = row.querySelectorAll(".sortableTable-value")
views = values[1].innerText
reads = values[2].innerText
readRatio = values[3].innerText
recommends = values[4].innerText
content += '"' + title + '"' + "," + views + "," + reads + "," + readRatio + "," + recommends + "\n"
});
download("medium-metrics-" + new Date().toISOString().slice(0, 10) + ".csv", content)

Paste the code into the Console box and press ‘Return’.

A .csv file will download to your downloads folder.

The file name will be named along the lines of ‘medium-metrics-year-month-day’ — e.g. medium-metrics-2019–09–19.csv

^ back to contents

2. Viewing your stats in Microsoft Excel

Open the .csv file in Microsoft Excel.

You’ll notice all of the data are bunched together in the first column. We’re going to fix that.

  • Select column A
  • Click ‘Data’ in the top menu
  • Click ‘Text to Columns’
  • ‘Delimited’ should be selected by default. Click ‘Next’.
  • In the ‘Delimiters’ section click ‘Semicolon’ then click ‘Next’.
  • On the next screen (Step 3 of 3) click ‘Finish’.

Your stats will now be split into columns.

You’ll notice the spreadsheet contains the stats but with no column headings. To fix this insert a new row at the top and add the labels in bold below. A description of each category has been included.

  • Story — the name of the story!
  • Views — the number of visitors who have clicked on a story’s page.
  • Reads — an estimate of the number of visitors who have read to the end of the story.
  • Read ratio — an estimate of the percentage of viewers that reached the end of the story. You’ll probably want to format the column to remove the decimal places.
  • Fans — the number of uniqute readers who ‘clapped’ the story.

^ back to contents

3. Notes about Medium stats

  • Stats are recorded for all ‘Published’ and ‘Unlisted’ stories and start from when the story first went live (i.e. no longer in ‘Drafts’).
  • If a story is subsequently unpublished (i.e. returned to draft) stats will no longer be collected for it, although the previous stats will remain unaffected. (Don’t ask me what happens to the stats if a previously published story gets deleted because I don’t know!)
  • Statistics are only collected for Stories and not Publications.
  • The chart at the top of the Stats page shows the total number of Views and Reads for all stories over preceding 30 day periods.
  • The chart also shows daily totals. Unfortunately this data cannot be downloaded.

Stats for individual stories

  • You can view the stats for an individual story by clicking on the cog icon at the top of the story page and choosing ‘View stats’.
  • This page shows ‘Total views’ and ‘Read ratio’ for the story along with a graph for the previous 30 days showing the number of visitors that have clicked through to the story from Medium (another Story, a Publication or a search result), and the number of visits — ‘External referrals — from outside Medium.
  • These stats cannot be downloaded.

Stats via email

After you have published your first story you will automatically receive a weekly email showing you some stats for the past seven days for all of your stories.

The email also shows stats for individual stories.

  • The first email after a story has been published will show the number of views so far.
  • Subsequent emails will show the increase since the previous week.

^ back to contents

--

--

Library for Educators

Sharing resources for educators, from The University of Manchester Library